You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2008/10/07 11:29:16 UTC

svn commit: r702408 - /geronimo/gshell/trunk/gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/FileObjectNameCompleter.java

Author: jdillon
Date: Tue Oct  7 02:29:16 2008
New Revision: 702408

URL: http://svn.apache.org/viewvc?rev=702408&view=rev
Log:
Close files

Modified:
    geronimo/gshell/trunk/gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/FileObjectNameCompleter.java

Modified: geronimo/gshell/trunk/gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/FileObjectNameCompleter.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/FileObjectNameCompleter.java?rev=702408&r1=702407&r2=702408&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/FileObjectNameCompleter.java (original)
+++ geronimo/gshell/trunk/gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/FileObjectNameCompleter.java Tue Oct  7 02:29:16 2008
@@ -61,10 +61,6 @@
             assert fileSystemAccess != null;
             FileObject file = fileSystemAccess.resolveFile(path);
 
-            //
-            // TODO: Close files
-            //
-            
             log.trace("Resolved file: {}", file);
 
             final String search;
@@ -102,7 +98,9 @@
                 int result = path.lastIndexOf(FileName.SEPARATOR) + 1;
 
                 log.trace("Result: {}", result);
-                
+
+                FileObjects.close(file);
+
                 return result;
             }
             else {
@@ -164,6 +162,8 @@
 
                     // noinspection unchecked
                     Collections.sort(candidates);
+
+                    FileObjects.closeAll(files);
                 }
             }
 
@@ -178,6 +178,8 @@
 
             log.trace("Result: {}", result);
 
+            FileObjects.close(file);
+
             return result;
         }
         catch (FileSystemException e) {