[jboss-cvs] JBossAS SVN: r91867 - projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jul 31 01:04:51 EDT 2009


Author: david.lloyd at jboss.com
Date: 2009-07-31 01:04:51 -0400 (Fri, 31 Jul 2009)
New Revision: 91867

Modified:
   projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/VFS.java
Log:
Add a couple more mount convenience methods

Modified: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/VFS.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/VFS.java	2009-07-31 05:03:35 UTC (rev 91866)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/VFS.java	2009-07-31 05:04:51 UTC (rev 91867)
@@ -420,6 +420,21 @@
    }
 
    /**
+    * Create and mount a zip file into the filesystem, returning a single handle which will unmount and close the file
+    * system when closed.
+    *
+    * @param zipFile a zip file in the VFS
+    * @param mountPoint the point at which the filesystem should be mounted
+    * @param tempFileProvider the temporary file provider
+    * @return a handle
+    * @throws IOException if an error occurs
+    */
+   public static Closeable mountZip(VirtualFile zipFile, VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException
+   {
+      return mountZip(zipFile.openStream(), zipFile.getName(), mountPoint, tempFileProvider);
+   }
+
+   /**
     * Create and mount a real file system, returning a single handle which will unmount and close the filesystem when
     * closed.
     *
@@ -553,6 +568,21 @@
    }
 
    /**
+    * Create and mount an expanded zip file in a temporary file system, returning a single handle which will unmount and
+    * close the filesystem when closed.  The given zip data stream is closed.
+    *
+    * @param zipFile a zip file in the VFS
+    * @param mountPoint the point at which the filesystem should be mounted
+    * @param tempFileProvider the temporary file provider
+    * @return a handle
+    * @throws IOException if an error occurs
+    */
+   public static Closeable mountZipExpanded(VirtualFile zipFile, VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException
+   {
+      return mountZipExpanded(zipFile.openStream(), zipFile.getName(), mountPoint, tempFileProvider);
+   }
+
+   /**
     * Expand a zip file to a destination directory.  The directory must exist.  If an error occurs, the destination
     * directory may contain a partially-extracted archive, so cleanup is up to the caller.
     *




More information about the jboss-cvs-commits mailing list