Package org.jboss.vfs

Class VFS

    • Method Detail

      • mount

        public static Closeable mount​(VirtualFile mountPoint,
                                      FileSystem fileSystem)
                               throws IOException
        Mount a filesystem on a mount point in the VFS. The mount point is any valid file name, existent or non-existent. If a relative path is given, it will be treated as relative to the VFS root.
        Parameters:
        mountPoint - the mount point
        fileSystem - the file system to mount
        Returns:
        a handle which can be used to unmount the filesystem
        Throws:
        IOException - if an I/O error occurs, such as a filesystem already being mounted at the given mount point
      • getChild

        public static VirtualFile getChild​(URI uri)
        Find a virtual file.
        Parameters:
        uri - the URI whose path component is the child path
        Returns:
        the child
        Throws:
        IllegalArgumentException - if the path is null
      • getRootVirtualFile

        public static VirtualFile getRootVirtualFile()
        Get the root virtual file for this VFS instance.
        Returns:
        the root virtual file
      • getChildren

        public static List<VirtualFile> getChildren()
                                             throws IOException
        Get the children
        Returns:
        the children
        Throws:
        IOException - for any problem accessing the virtual file system
      • mountZip

        public static Closeable mountZip​(File zipFile,
                                         VirtualFile mountPoint,
                                         TempFileProvider tempFileProvider)
                                  throws IOException
        Create and mount a zip file into the filesystem, returning a single handle which will unmount and close the file system when closed.
        Parameters:
        zipFile - the zip file to mount
        mountPoint - the point at which the filesystem should be mounted
        tempFileProvider - the temporary file provider
        Returns:
        a handle
        Throws:
        IOException - if an error occurs
      • mountZip

        public static Closeable mountZip​(InputStream zipData,
                                         String zipName,
                                         VirtualFile mountPoint,
                                         TempFileProvider tempFileProvider)
                                  throws IOException
        Create and mount a zip file into the filesystem, returning a single handle which will unmount and close the file system when closed.
        Parameters:
        zipData - an input stream containing the zip data
        zipName - the name of the archive
        mountPoint - the point at which the filesystem should be mounted
        tempFileProvider - the temporary file provider
        Returns:
        a handle
        Throws:
        IOException - if an error occurs
      • mountZip

        public static Closeable mountZip​(VirtualFile zipFile,
                                         VirtualFile mountPoint,
                                         TempFileProvider tempFileProvider)
                                  throws IOException
        Create and mount a zip file into the filesystem, returning a single handle which will unmount and close the file system when closed.
        Parameters:
        zipFile - a zip file in the VFS
        mountPoint - the point at which the filesystem should be mounted
        tempFileProvider - the temporary file provider
        Returns:
        a handle
        Throws:
        IOException - if an error occurs
      • mountReal

        public static Closeable mountReal​(File realRoot,
                                          VirtualFile mountPoint)
                                   throws IOException
        Create and mount a real file system, returning a single handle which will unmount and close the filesystem when closed.
        Parameters:
        realRoot - the real filesystem root
        mountPoint - the point at which the filesystem should be mounted
        Returns:
        a handle
        Throws:
        IOException - if an error occurs
      • mountTemp

        public static Closeable mountTemp​(VirtualFile mountPoint,
                                          TempFileProvider tempFileProvider)
                                   throws IOException
        Create and mount a temporary file system, returning a single handle which will unmount and close the filesystem when closed.
        Parameters:
        mountPoint - the point at which the filesystem should be mounted
        tempFileProvider - the temporary file provider
        Returns:
        a handle
        Throws:
        IOException - if an error occurs
      • mountZipExpanded

        public static Closeable mountZipExpanded​(File zipFile,
                                                 VirtualFile mountPoint,
                                                 TempFileProvider tempFileProvider)
                                          throws IOException
        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.
        Parameters:
        zipFile - the zip file to mount
        mountPoint - the point at which the filesystem should be mounted
        tempFileProvider - the temporary file provider
        Returns:
        a handle
        Throws:
        IOException - if an error occurs
      • mountZipExpanded

        public static Closeable mountZipExpanded​(InputStream zipData,
                                                 String zipName,
                                                 VirtualFile mountPoint,
                                                 TempFileProvider tempFileProvider)
                                          throws IOException
        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.
        Parameters:
        zipData - an input stream containing the zip data
        zipName - the name of the archive
        mountPoint - the point at which the filesystem should be mounted
        tempFileProvider - the temporary file provider
        Returns:
        a handle
        Throws:
        IOException - if an error occurs
      • mountZipExpanded

        public static Closeable mountZipExpanded​(VirtualFile zipFile,
                                                 VirtualFile mountPoint,
                                                 TempFileProvider tempFileProvider)
                                          throws IOException
        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.
        Parameters:
        zipFile - a zip file in the VFS
        mountPoint - the point at which the filesystem should be mounted
        tempFileProvider - the temporary file provider
        Returns:
        a handle
        Throws:
        IOException - if an error occurs
      • mountAssembly

        public static Closeable mountAssembly​(VirtualFileAssembly assembly,
                                              VirtualFile mountPoint)
                                       throws IOException
        Create and mount an assembly file system, returning a single handle which will unmount and close the filesystem when closed.
        Parameters:
        assembly - an VirtualFileAssembly to mount in the VFS
        mountPoint - the point at which the filesystem should be mounted
        Returns:
        a handle
        Throws:
        IOException - if an error occurs