commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r1002142 - /commons/proper/io/trunk/src/java/org/apache/commons/io/output/LockableFileWriter.java
Date Tue, 28 Sep 2010 12:31:40 GMT
Author: niallp
Date: Tue Sep 28 12:31:40 2010
New Revision: 1002142

URL: http://svn.apache.org/viewvc?rev=1002142&view=rev
Log:
IO-216 Delete files quietly when an exception is thrown during initialization

Modified:
    commons/proper/io/trunk/src/java/org/apache/commons/io/output/LockableFileWriter.java

Modified: commons/proper/io/trunk/src/java/org/apache/commons/io/output/LockableFileWriter.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/java/org/apache/commons/io/output/LockableFileWriter.java?rev=1002142&r1=1002141&r2=1002142&view=diff
==============================================================================
--- commons/proper/io/trunk/src/java/org/apache/commons/io/output/LockableFileWriter.java
(original)
+++ commons/proper/io/trunk/src/java/org/apache/commons/io/output/LockableFileWriter.java
Tue Sep 28 12:31:40 2010
@@ -241,17 +241,17 @@ public class LockableFileWriter extends 
         } catch (IOException ex) {
             IOUtils.closeQuietly(writer);
             IOUtils.closeQuietly(stream);
-            lockFile.delete();
+            FileUtils.deleteQuietly(lockFile);
             if (fileExistedAlready == false) {
-                file.delete();
+                FileUtils.deleteQuietly(file);
             }
             throw ex;
         } catch (RuntimeException ex) {
             IOUtils.closeQuietly(writer);
             IOUtils.closeQuietly(stream);
-            lockFile.delete();
+            FileUtils.deleteQuietly(lockFile);
             if (fileExistedAlready == false) {
-                file.delete();
+                FileUtils.deleteQuietly(file);
             }
             throw ex;
         }



Mime
View raw message