diff options
| author | Mark Wielaard <mark@gcc.gnu.org> | 2006-01-17 18:09:40 +0000 |
|---|---|---|
| committer | Mark Wielaard <mark@gcc.gnu.org> | 2006-01-17 18:09:40 +0000 |
| commit | 2127637945ea6b763966398130e0770fa993c860 (patch) | |
| tree | c976ca91e3ef0bda3b34b37c0195145638d8d08e /libjava/classpath/java/io/File.java | |
| parent | bcb36c3e02e3bd2843aad1b9888513dfb5d6e337 (diff) | |
Imported GNU Classpath 0.20
Imported GNU Classpath 0.20
* Makefile.am (AM_CPPFLAGS): Add classpath/include.
* java/nio/charset/spi/CharsetProvider.java: New override file.
* java/security/Security.java: Likewise.
* sources.am: Regenerated.
* Makefile.in: Likewise.
From-SVN: r109831
Diffstat (limited to 'libjava/classpath/java/io/File.java')
| -rw-r--r-- | libjava/classpath/java/io/File.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libjava/classpath/java/io/File.java b/libjava/classpath/java/io/File.java index 3c7ac21301c..43e8e5ded6c 100644 --- a/libjava/classpath/java/io/File.java +++ b/libjava/classpath/java/io/File.java @@ -396,7 +396,8 @@ public class File implements Serializable, Comparable * This method initializes a new <code>File</code> object to represent * a file corresponding to the specified <code>file:</code> protocol URI. * - * @param uri The uri. + * @param uri The URI + * @throws IllegalArgumentException if the URI is not hierarchical */ public File(URI uri) { @@ -406,7 +407,11 @@ public class File implements Serializable, Comparable if (!uri.getScheme().equals("file")) throw new IllegalArgumentException("invalid uri protocol"); - path = normalizePath(uri.getPath()); + String name = uri.getPath(); + if (name == null) + throw new IllegalArgumentException("URI \"" + uri + + "\" is not hierarchical"); + path = normalizePath(name); } /** |
