diff options
Diffstat (limited to 'libjava/java/io/File.java')
-rw-r--r-- | libjava/java/io/File.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libjava/java/io/File.java b/libjava/java/io/File.java index fc3477c..5962641 100644 --- a/libjava/java/io/File.java +++ b/libjava/java/io/File.java @@ -11,6 +11,7 @@ details. */ package java.io; import java.util.*; +import java.net.*; import gnu.gcj.runtime.FileDeleter; /** @@ -106,8 +107,18 @@ public class File implements Serializable return System.getProperty("user.dir") + separatorChar + path; } + public File getAbsoluteFile () throws IOException + { + return new File (getAbsolutePath()); + } + public native String getCanonicalPath () throws IOException; + public File getCanonicalFile () throws IOException + { + return new File (getCanonicalPath()); + } + public String getName () { int last = path.lastIndexOf(separatorChar); @@ -178,6 +189,11 @@ public class File implements Serializable return path; } + public URL toURL () throws MalformedURLException + { + return new URL ("file:" + path + (isDirectory() ? "/" : "")); + } + private final native boolean performMkdir (); public boolean mkdir () { |