diff options
author | Gary Benson <gbenson@redhat.com> | 2006-07-14 14:37:46 +0000 |
---|---|---|
committer | Gary Benson <gary@gcc.gnu.org> | 2006-07-14 14:37:46 +0000 |
commit | 1470f196e47e33334ca4ff0cd71ebd3a1bad30de (patch) | |
tree | 53e2d702b1acd9f0d465a7e1a07b9c7008bdf764 /libjava/java/io | |
parent | 8c2e5f361c5e3b72fb8ad110d79e4f88e49eb449 (diff) | |
download | gcc-1470f196e47e33334ca4ff0cd71ebd3a1bad30de.zip gcc-1470f196e47e33334ca4ff0cd71ebd3a1bad30de.tar.gz gcc-1470f196e47e33334ca4ff0cd71ebd3a1bad30de.tar.bz2 |
File.java (internalExists): New method.
2006-07-14 Gary Benson <gbenson@redhat.com>
* java/io/File.java (internalExists): New method.
(exists): Use internalExists.
(internalIsDirectory): New method.
(isDirectory): Use internalIsDirectory.
(createTempFile): Use internalExists and internalIsDirectory.
From-SVN: r115441
Diffstat (limited to 'libjava/java/io')
-rw-r--r-- | libjava/java/io/File.java | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/libjava/java/io/File.java b/libjava/java/io/File.java index 8e2946f..ed1ca94 100644 --- a/libjava/java/io/File.java +++ b/libjava/java/io/File.java @@ -259,6 +259,15 @@ public class File implements Serializable, Comparable return path.equalsIgnoreCase(other.path); } + /* + * This method tests whether or not the file represented by the + * object actually exists on the filesystem. + */ + private boolean internalExists() + { + return _access (EXISTS); + } + /** * This method tests whether or not the file represented by the object * actually exists on the filesystem. @@ -270,7 +279,7 @@ public class File implements Serializable, Comparable public boolean exists() { checkRead(); - return _access (EXISTS); + return internalExists(); } /** @@ -685,6 +694,15 @@ public class File implements Serializable, Comparable */ public native boolean isAbsolute(); + /* + * This method tests whether or not the file represented by this + * object is a directory. + */ + private boolean internalIsDirectory() + { + return _stat (DIRECTORY); + } + /** * This method tests whether or not the file represented by this object * is a directory. In order for this method to return <code>true</code>, @@ -698,7 +716,7 @@ public class File implements Serializable, Comparable public boolean isDirectory() { checkRead(); - return _stat (DIRECTORY); + return internalIsDirectory(); } /** @@ -1069,10 +1087,10 @@ public class File implements Serializable, Comparable throw new IOException("Cannot determine system temporary directory"); directory = new File(dirname); - if (!directory.exists()) + if (!directory.internalExists()) throw new IOException("System temporary directory " + directory.getName() + " does not exist."); - if (!directory.isDirectory()) + if (!directory.internalIsDirectory()) throw new IOException("System temporary directory " + directory.getName() + " is not really a directory."); |