aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorAlexandre Petit-Bianco <apbianco@redhat.com>2001-02-09 00:30:31 -0800
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>2001-02-09 00:30:31 -0800
commit010cc79a7e96baadcd35c2fad212682db02d3ff2 (patch)
tree00fee14fe16afd828b8bc6dff86537e677cacaaa /libjava
parent58e31b83cf1ed5fd178aab26d10464af3ec8aac9 (diff)
downloadgcc-010cc79a7e96baadcd35c2fad212682db02d3ff2.zip
gcc-010cc79a7e96baadcd35c2fad212682db02d3ff2.tar.gz
gcc-010cc79a7e96baadcd35c2fad212682db02d3ff2.tar.bz2
File.java (java.net): Imported.
2001-02-09 Alexandre Petit-Bianco <apbianco@redhat.com> * java/io/File.java (java.net): Imported. (getAbsoluteFile): Added. (getCanonicalPath): Likewise. (toURL): Likewise. (http://gcc.gnu.org/ml/java-patches/2001-q1/msg00208.html) From-SVN: r39562
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog7
-rw-r--r--libjava/java/io/File.java16
2 files changed, 23 insertions, 0 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 6848231..e1fdd1f 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,10 @@
+2001-02-09 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * java/io/File.java (java.net): Imported.
+ (getAbsoluteFile): Added.
+ (getCanonicalPath): Likewise.
+ (toURL): Likewise.
+
2001-02-08 Bryce McKinlay <bryce@albatross.co.nz>
* java/lang/Byte.java: Remove redundant instanceof and null checks.
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 ()
{