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
This commit is contained in:
parent
58e31b83cf
commit
010cc79a7e
@ -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>
|
2001-02-08 Bryce McKinlay <bryce@albatross.co.nz>
|
||||||
|
|
||||||
* java/lang/Byte.java: Remove redundant instanceof and null checks.
|
* java/lang/Byte.java: Remove redundant instanceof and null checks.
|
||||||
|
@ -11,6 +11,7 @@ details. */
|
|||||||
package java.io;
|
package java.io;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.net.*;
|
||||||
import gnu.gcj.runtime.FileDeleter;
|
import gnu.gcj.runtime.FileDeleter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -106,8 +107,18 @@ public class File implements Serializable
|
|||||||
return System.getProperty("user.dir") + separatorChar + path;
|
return System.getProperty("user.dir") + separatorChar + path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public File getAbsoluteFile () throws IOException
|
||||||
|
{
|
||||||
|
return new File (getAbsolutePath());
|
||||||
|
}
|
||||||
|
|
||||||
public native String getCanonicalPath () throws IOException;
|
public native String getCanonicalPath () throws IOException;
|
||||||
|
|
||||||
|
public File getCanonicalFile () throws IOException
|
||||||
|
{
|
||||||
|
return new File (getCanonicalPath());
|
||||||
|
}
|
||||||
|
|
||||||
public String getName ()
|
public String getName ()
|
||||||
{
|
{
|
||||||
int last = path.lastIndexOf(separatorChar);
|
int last = path.lastIndexOf(separatorChar);
|
||||||
@ -178,6 +189,11 @@ public class File implements Serializable
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public URL toURL () throws MalformedURLException
|
||||||
|
{
|
||||||
|
return new URL ("file:" + path + (isDirectory() ? "/" : ""));
|
||||||
|
}
|
||||||
|
|
||||||
private final native boolean performMkdir ();
|
private final native boolean performMkdir ();
|
||||||
public boolean mkdir ()
|
public boolean mkdir ()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user