In case this gets missed - this one does change the API in that we're
now throwing an Exception where we didn't used to before. Seems to me
that not throwing it before was a bug, therefore this is an acceptable
API change. I don't know if it was being left open because people felt
it was an unacceptable change, so sending this note.

On 12/4/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to