diff options
author | Jeroen Frijters <jeroen@sumatra.nl> | 2004-07-27 08:44:07 +0000 |
---|---|---|
committer | Jeroen Frijters <jeroen@sumatra.nl> | 2004-07-27 08:44:07 +0000 |
commit | b94f90862e83305ec7490f2da6ce634b9696a486 (patch) | |
tree | 740b951412a419b7e6f075c2f2bf479a75a0fb2f /vm | |
parent | 17f622d5b01f072c9c34f67e5205d9848a5a176f (diff) | |
download | classpath-b94f90862e83305ec7490f2da6ce634b9696a486.tar.gz |
2004-07-27 Jeroen Frijters <jeroen@frijters.net>
* vm/reference/java/io/VMFile.java (toCanonicalForm): New method.
* java/io/File.java (dupSeparator): New field. (File(String)):
Modified to use new normalizePath method. (normalizePath): New method
merged from libgcj.
(File(String,String)): Modified to use new normalizePath method.
(File(File,String)): Modified to forward to File(String,String).
(File(URI)): New constructor. (getAbsolutePath): Merged from libgcj.
(getCanonicalPath): New implementation that forwards to VMFile.
(getParent): Merged from libgcj. (isAbsolute): Merged from libgcj.
(list(FilenameFilter)): Removed unnecessary path normalization.
(toURL): Merged from libgcj. (mkdir): Removed unnecessary path
normalization. (compareTo): Removed incorrect canonicalization.
Diffstat (limited to 'vm')
-rw-r--r-- | vm/reference/java/io/VMFile.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/vm/reference/java/io/VMFile.java b/vm/reference/java/io/VMFile.java index ffa305359..c88b9b69f 100644 --- a/vm/reference/java/io/VMFile.java +++ b/vm/reference/java/io/VMFile.java @@ -191,4 +191,23 @@ final class VMFile return path.substring(pos + File.separator.length()); } + + /** + * This method returns a canonical representation of the pathname of + * this file. The actual form of the canonical representation is + * different. On the GNU system, the canonical form differs from the + * absolute form in that all relative file references to "." and ".." + * are resolved and removed. + * <p> + * Note that this method, unlike the other methods which return path + * names, can throw an IOException. This is because native method + * might be required in order to resolve the canonical path + * + * @exception IOException If an error occurs + */ + public String toCanonicalForm(String path) throws IOException + { + // FIXME: this only works on UNIX + return PlatformHelper.toCanonicalForm(path); + } } |