summaryrefslogtreecommitdiffstats
path: root/libjava/java/io
diff options
context:
space:
mode:
authorapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>2001-02-09 08:30:31 +0000
committerapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>2001-02-09 08:30:31 +0000
commit73c93a3884e79744fcccff9e73e4f42ea7a02ef9 (patch)
tree00fee14fe16afd828b8bc6dff86537e677cacaaa /libjava/java/io
parent29b5988f5dd81c9ea6ad50587ece6c27dd8c273b (diff)
downloadppe42-gcc-73c93a3884e79744fcccff9e73e4f42ea7a02ef9.tar.gz
ppe42-gcc-73c93a3884e79744fcccff9e73e4f42ea7a02ef9.zip
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) git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39562 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/io')
-rw-r--r--libjava/java/io/File.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/libjava/java/io/File.java b/libjava/java/io/File.java
index fc3477c040b..5962641760d 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 ()
{
OpenPOWER on IntegriCloud