commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r789301 - in /commons/sandbox/runtime/trunk/src: main/java/org/apache/commons/runtime/io/FileAttributes.java test/org/apache/commons/runtime/TestFile.java
Date Mon, 29 Jun 2009 11:56:25 GMT
Author: mturk
Date: Mon Jun 29 11:56:25 2009
New Revision: 789301

URL: http://svn.apache.org/viewvc?rev=789301&view=rev
Log:
Fix typo and test cases

Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileAttributes.java
    commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestFile.java

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileAttributes.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileAttributes.java?rev=789301&r1=789300&r2=789301&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileAttributes.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileAttributes.java
Mon Jun 29 11:56:25 2009
@@ -26,7 +26,7 @@
     /** File is read-only */
     READ(       0x01),
     /** File is executable */
-    EXCUTABLE(  0x02),
+    EXECUTABLE( 0x02),
     /** File is hidden */
     HIDDEN(     0x04);
 

Modified: commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestFile.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestFile.java?rev=789301&r1=789300&r2=789301&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestFile.java (original)
+++ commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestFile.java Mon Jun
29 11:56:25 2009
@@ -223,10 +223,12 @@
         EnumSet <FileProtection> fp = f.getFileProtection();
         System.out.println("Org Attr Protection " + fp);
         // Set the rdonly attributes
-        f.setFileAttributes(EnumSet.of(FileAttributes.READ), EnumSet.allOf(FileAttributes.class));
+        f.setFileAttributes(EnumSet.of(FileAttributes.READ), EnumSet.of(FileAttributes.READ));
         EnumSet <FileProtection> np = f.getFileProtection();
         System.out.println("Set Attr Protection " + np);
         assertFalse("UWRITE", np.contains(FileProtection.UWRITE));
+        // Clear the rdonly attribute so we can delete the file
+        f.setFileAttributes(EnumSet.noneOf(FileAttributes.class), EnumSet.of(FileAttributes.READ));
         f.delete();
     }
 
@@ -254,7 +256,7 @@
         f.createNewFile();
         EnumSet <FileProtection> fp = f.getFileProtection();
         System.out.println("Clr Attr Protection " + fp);
-        f.setFileAttributes(EnumSet.allOf(FileAttributes.class), EnumSet.allOf(FileAttributes.class));
+        f.setFileAttributes(EnumSet.allOf(FileAttributes.class), EnumSet.of(FileAttributes.READ,
FileAttributes.EXECUTABLE));
         EnumSet <FileProtection> cp = f.getFileProtection();
         System.out.println("Rst Attr Protection " + cp);
         // Clear the rdonly attributes



Mime
View raw message