commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r482411 - /jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java
Date Mon, 04 Dec 2006 23:36:01 GMT
Author: bayard
Date: Mon Dec  4 15:35:54 2006
New Revision: 482411

URL: http://svn.apache.org/viewvc?view=rev&rev=482411
Log:
Applied the fix suggested by Mirko Friedenhagen in #IO-100. This isn't something that it's
easy to write a unit test for, but it is very easy to write a platform dependent test and
show that the new code correctly throws an exception for '/etc/passwd'

Modified:
    jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java

Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java?view=diff&rev=482411&r1=482410&r2=482411
==============================================================================
--- jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java (original)
+++ jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java Mon Dec
 4 15:35:54 2006
@@ -142,7 +142,10 @@
             OutputStream out = new FileOutputStream(file);
             IOUtils.closeQuietly(out);
         }
-        file.setLastModified(System.currentTimeMillis());
+        boolean success = file.setLastModified(System.currentTimeMillis());
+        if(!success) {
+            throw new IOException("Unable to set the last modification time for " + file);
+        }
     }
 
     //-----------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message