You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by rg...@apache.org on 2011/09/25 08:16:24 UTC

svn commit: r1175302 - in /commons/proper/vfs/trunk: core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileObject.java src/changes/changes.xml

Author: rgoers
Date: Sun Sep 25 06:16:23 2011
New Revision: 1175302

URL: http://svn.apache.org/viewvc?rev=1175302&view=rev
Log:
Fix VFS-359 - Don't delete a RamFileObject if it is open

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileObject.java
    commons/proper/vfs/trunk/src/changes/changes.xml

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileObject.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileObject.java?rev=1175302&r1=1175301&r2=1175302&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileObject.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileObject.java Sun Sep 25 06:16:23 2011
@@ -135,6 +135,10 @@ public class RamFileObject extends Abstr
     @Override
     protected void doDelete() throws Exception
     {
+
+        if (this.isContentOpen()) {
+            throw new FileSystemException(this.getName() + " cannot be deleted while the file is openg");
+        }
         fs.delete(this);
     }
 

Modified: commons/proper/vfs/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/src/changes/changes.xml?rev=1175302&r1=1175301&r2=1175302&view=diff
==============================================================================
--- commons/proper/vfs/trunk/src/changes/changes.xml (original)
+++ commons/proper/vfs/trunk/src/changes/changes.xml Sun Sep 25 06:16:23 2011
@@ -23,6 +23,9 @@
 
   <body>
     <release version="2.1" date="TBD" description="">
+      <action issue="VFS-359" dev="rgoers" type="fix" due-to="Miroslav Pokorny">
+        Don't delete a RamFileObject if it is open.
+      </action>
       <action issue="VFS-352" dev="rgoers" type="fix">
         ZipFileSystem now uses an internal Map as a cache for all the files in the zip archive.
       </action>