harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r414606 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java
Date Thu, 15 Jun 2006 15:02:01 GMT
Author: tellison
Date: Thu Jun 15 08:02:01 2006
New Revision: 414606

URL: http://svn.apache.org/viewvc?rev=414606&view=rev
Log:
Directory delete should not check read permission (a side-effect of calling isDirectory())

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java?rev=414606&r1=414605&r2=414606&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java
Thu Jun 15 08:02:01 2006
@@ -348,12 +348,16 @@
 	 * @see java.lang.SecurityManager#checkDelete
 	 */
 	public boolean delete() {
-		SecurityManager security = System.getSecurityManager();
-		if (security != null)
-			security.checkDelete(path);
-		return isDirectory() ? deleteDirImpl(properPath(true))
-				: deleteFileImpl(properPath(true));
-	}
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+            security.checkDelete(path);
+        }
+        byte[] propPath = properPath(true);
+        if ((path.length() != 0) && isDirectoryImpl(propPath)) {
+            return deleteDirImpl(propPath);
+        }
+        return deleteFileImpl(propPath);
+    }
 
 	private native boolean deleteDirImpl(byte[] filePath);
 



Mime
View raw message