This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: Patch: java.io.File


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


I commited the attached patch to trunk to merge java.io.File a little 
bit more with classpath.


Michael
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+9JF/WSOgCCdjSDsRAgKoAJ9saO5ElOas3VuoibYUvMWyXieJWACdHRZS
Snx46/MPd+fiPZgx1KL0K6I=
=pjZw
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.1979
diff -u -b -B -r1.1979 ChangeLog
--- ChangeLog	21 Jun 2003 14:02:09 -0000	1.1979
+++ ChangeLog	21 Jun 2003 17:04:48 -0000
@@ -1,5 +1,15 @@
 2003-06-21  Michael Koch  <konqueror@gmx.de>
 
+	* java/io/File.java
+	(static): Load javaio lib if existing (only in classpath).
+	(File): Revised documentation to show the correct argument name.
+	(createTempFile): Partly merged with classpath.
+	(compareTo): Simplified.
+	(lastModified): Throw exception if time < 0.
+	(deleteOnExit): Revised documentation.
+
+2003-06-21  Michael Koch  <konqueror@gmx.de>
+
 	* java/net/PlainSocketImpl.java:
 	Reformatted.
 	(PlainSocketImpl): Merged class documentaion with classpath.
Index: java/io/File.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/File.java,v
retrieving revision 1.34
diff -u -b -B -r1.34 File.java
--- java/io/File.java	20 May 2003 09:13:19 -0000	1.34
+++ java/io/File.java	21 Jun 2003 17:04:49 -0000
@@ -40,6 +40,7 @@
 
 import java.net.MalformedURLException;
 import java.net.URL;
+import gnu.classpath.Configuration;
 import gnu.gcj.runtime.FileDeleter;
 
 /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
@@ -119,7 +119,12 @@
   
   static
   {
-    init_native();
+    if (Configuration.INIT_LOAD_LIBRARY)
+      {
+        System.loadLibrary ("javaio");
+      }
+    
+    init_native ();
   }
   
   // Native function called at class initialization. This should should
@@ -345,7 +350,7 @@
    * name.  If the directory path name ends in the separator string, another
    * separator string will still be appended.
    *
-   * @param dirname The path to the directory the file resides in
+   * @param dirPath The path to the directory the file resides in
    * @param name The name of the file
    */
   public File (String dirPath, String name)
@@ -711,7 +716,6 @@
    * This native function actually produces the list of file in this
    * directory
    */
-    
   private final native Object[] performList (FilenameFilter filter,
 					     FileFilter fileFilter,
 					     Class result_type);
@@ -986,19 +990,19 @@
       {
 	String dirname = tmpdir;
 	if (dirname == null)
-	  throw 
-	    new IOException ("Cannot determine system temporary directory"); 
+          throw new IOException ("Cannot determine system temporary directory"); 
 	
 	directory = new File (dirname);
 	if (!directory.exists ())
 	  throw new IOException ("System temporary directory " 
-				 + directory.getName() + " does not exist.");
-	if (!directory.isDirectory())
+                                 + directory.getName () + " does not exist.");
+        if (!directory.isDirectory ())
 	  throw new IOException ("System temporary directory " 
-				 + directory.getName() 
+                                 + directory.getName ()
 				 + " is not really a directory.");
       }
 
+    // Now process the prefix and suffix.
     if (prefix.length () < 3)
       throw new IllegalArgumentException ("Prefix too short: " + prefix);
 
@@ -1162,7 +1166,7 @@
    *
    * @since 1.2
    */
-  public int compareTo(File other)
+  public int compareTo (File other)
   {
     if (caseSensitive)
       return path.compareTo (other.path);
@@ -1191,10 +1195,9 @@
    *
    * @since 1.2
    */
-  public int compareTo(Object o)
+  public int compareTo (Object obj)
   {
-    File other = (File) o;
-    return compareTo (other);
+    return compareTo ((File) obj);
   }
 
   /*
@@ -1250,6 +1253,9 @@
    */
   public boolean setLastModified (long time) 
   {
+    if (time < 0)
+      throw new IllegalArgumentException("Negative modification time: " + time);
+
     checkWrite ();
     return performSetLastModified(time);
   }
@@ -1275,6 +1281,8 @@
   /** 
    * Add this File to the set of files to be deleted upon normal
    * termination.
+   *
+   * @exception SecurityException If deleting of the file is not allowed
    *
    * @since 1.2 
    */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]