summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgary <gary@138bc75d-0d04-0410-961f-82ee72b054a4>2006-07-14 14:37:46 +0000
committergary <gary@138bc75d-0d04-0410-961f-82ee72b054a4>2006-07-14 14:37:46 +0000
commit541356c4d5db3dcd9c6480c78abfc84c62f07a4c (patch)
tree53e2d702b1acd9f0d465a7e1a07b9c7008bdf764
parentf24ac6f615cd843f6d876d817b4e930fef88e4c7 (diff)
downloadgcc-541356c4d5db3dcd9c6480c78abfc84c62f07a4c.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115441 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libjava/ChangeLog8
-rw-r--r--libjava/java/io/File.java26
2 files changed, 30 insertions, 4 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index d9c0f7a0375..ba4f72cb153 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,11 @@
+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.
+
2006-07-13 Bryce McKinlay <mckinlay@redhat.com>
* interpret.cc (_Jv_InterpMethod::run): Don't SAVE_PC for fdiv.
diff --git a/libjava/java/io/File.java b/libjava/java/io/File.java
index 8e2946ff4fd..ed1ca946ed3 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.");