public class VFS extends Object
Modifier and Type | Method and Description |
---|---|
static VirtualFile |
getChild(String path)
Find a virtual file.
|
static VirtualFile |
getChild(URI uri)
Find a virtual file.
|
static VirtualFile |
getChild(URL url)
Deprecated.
use getChild(URI) instead
|
static List<VirtualFile> |
getChildren()
Get the children
|
static List<VirtualFile> |
getChildren(VirtualFileFilter filter)
Get the children
|
static List<VirtualFile> |
getChildrenRecursively()
Get all the children recursively
|
static List<VirtualFile> |
getChildrenRecursively(VirtualFileFilter filter)
Get all the children recursively
|
static VirtualFile |
getRootVirtualFile()
Get the root virtual file for this VFS instance.
|
static Closeable |
mount(VirtualFile mountPoint,
FileSystem fileSystem)
Mount a filesystem on a mount point in the VFS.
|
static Closeable |
mountAssembly(VirtualFileAssembly assembly,
VirtualFile mountPoint)
Create and mount an assembly file system, returning a single handle which will unmount and
close the filesystem when closed.
|
static Closeable |
mountReal(File realRoot,
VirtualFile mountPoint)
Create and mount a real file system, returning a single handle which will unmount and close the filesystem when
closed.
|
static Closeable |
mountTemp(VirtualFile mountPoint,
TempFileProvider tempFileProvider)
Create and mount a temporary file system, returning a single handle which will unmount and close the filesystem
when closed.
|
static Closeable |
mountZip(File zipFile,
VirtualFile mountPoint,
TempFileProvider tempFileProvider)
Create and mount a zip file into the filesystem, returning a single handle which will unmount and close the file
system when closed.
|
static Closeable |
mountZip(InputStream zipData,
String zipName,
VirtualFile mountPoint,
TempFileProvider tempFileProvider)
Create and mount a zip file into the filesystem, returning a single handle which will unmount and close the file
system when closed.
|
static Closeable |
mountZip(VirtualFile zipFile,
VirtualFile mountPoint,
TempFileProvider tempFileProvider)
Create and mount a zip file into the filesystem, returning a single handle which will unmount and close the file
system when closed.
|
static Closeable |
mountZipExpanded(File zipFile,
VirtualFile mountPoint,
TempFileProvider tempFileProvider)
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.
|
static Closeable |
mountZipExpanded(InputStream zipData,
String zipName,
VirtualFile mountPoint,
TempFileProvider tempFileProvider)
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.
|
static Closeable |
mountZipExpanded(VirtualFile zipFile,
VirtualFile mountPoint,
TempFileProvider tempFileProvider)
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.
|
protected static void |
visit(VirtualFile file,
VirtualFileVisitor visitor)
Visit the virtual file system
|
static void |
visit(VirtualFileVisitor visitor)
Visit the virtual file system from the root
|
public static Closeable mount(VirtualFile mountPoint, FileSystem fileSystem) throws IOException
mountPoint
- the mount pointfileSystem
- the file system to mountIOException
- if an I/O error occurs, such as a filesystem already being mounted at the given mount point@Deprecated public static VirtualFile getChild(URL url) throws URISyntaxException
url
- the URL whose path component is the child pathIllegalArgumentException
- if the path is nullURISyntaxException
- for any uri errorpublic static VirtualFile getChild(URI uri)
uri
- the URI whose path component is the child pathIllegalArgumentException
- if the path is nullpublic static VirtualFile getChild(String path)
path
- the child pathIllegalArgumentException
- if the path is nullpublic static VirtualFile getRootVirtualFile()
public static List<VirtualFile> getChildren() throws IOException
IOException
- for any problem accessing the virtual file systempublic static List<VirtualFile> getChildren(VirtualFileFilter filter) throws IOException
filter
- to filter the childrenIOException
- for any problem accessing the virtual file systempublic static List<VirtualFile> getChildrenRecursively() throws IOException
This always uses
VisitorAttributes.RECURSE
IOException
- for any problem accessing the virtual file systempublic static List<VirtualFile> getChildrenRecursively(VirtualFileFilter filter) throws IOException
This always uses
VisitorAttributes.RECURSE
filter
- to filter the childrenIOException
- for any problem accessing the virtual file systempublic static void visit(VirtualFileVisitor visitor) throws IOException
visitor
- the visitorIOException
- for any problem accessing the VFSIllegalArgumentException
- if the visitor is nullprotected static void visit(VirtualFile file, VirtualFileVisitor visitor) throws IOException
file
- the filevisitor
- the visitorIOException
- for any problem accessing the VFSIllegalArgumentException
- if the file or visitor is nullpublic static Closeable mountZip(File zipFile, VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException
zipFile
- the zip file to mountmountPoint
- the point at which the filesystem should be mountedtempFileProvider
- the temporary file providerIOException
- if an error occurspublic static Closeable mountZip(InputStream zipData, String zipName, VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException
zipData
- an input stream containing the zip datazipName
- the name of the archivemountPoint
- the point at which the filesystem should be mountedtempFileProvider
- the temporary file providerIOException
- if an error occurspublic static Closeable mountZip(VirtualFile zipFile, VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException
zipFile
- a zip file in the VFSmountPoint
- the point at which the filesystem should be mountedtempFileProvider
- the temporary file providerIOException
- if an error occurspublic static Closeable mountReal(File realRoot, VirtualFile mountPoint) throws IOException
realRoot
- the real filesystem rootmountPoint
- the point at which the filesystem should be mountedIOException
- if an error occurspublic static Closeable mountTemp(VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException
mountPoint
- the point at which the filesystem should be mountedtempFileProvider
- the temporary file providerIOException
- if an error occurspublic static Closeable mountZipExpanded(File zipFile, VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException
zipFile
- the zip file to mountmountPoint
- the point at which the filesystem should be mountedtempFileProvider
- the temporary file providerIOException
- if an error occurspublic static Closeable mountZipExpanded(InputStream zipData, String zipName, VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException
zipData
- an input stream containing the zip datazipName
- the name of the archivemountPoint
- the point at which the filesystem should be mountedtempFileProvider
- the temporary file providerIOException
- if an error occurspublic static Closeable mountZipExpanded(VirtualFile zipFile, VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException
zipFile
- a zip file in the VFSmountPoint
- the point at which the filesystem should be mountedtempFileProvider
- the temporary file providerIOException
- if an error occurspublic static Closeable mountAssembly(VirtualFileAssembly assembly, VirtualFile mountPoint) throws IOException
assembly
- an VirtualFileAssembly
to mount in the VFSmountPoint
- the point at which the filesystem should be mountedIOException
- if an error occursCopyright © 2012 JBoss by Red Hat. All Rights Reserved.