public class VFS
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private static class |
VFS.EmptyRemovableSet<E> |
private static class |
VFS.LeakDescriptor |
(package private) static class |
VFS.Mount
The mount representation.
|
| Modifier and Type | Field and Description |
|---|---|
private static java.util.Set |
EMPTY_REMOVABLE_SET |
private static java.util.concurrent.ConcurrentMap<VirtualFile,java.util.Map<java.lang.String,VFS.Mount>> |
mounts |
private static VFS.Mount |
rootMount |
private static VirtualFile |
rootVirtualFile |
| Modifier | Constructor and Description |
|---|---|
private |
VFS()
Do not allow construction
|
| Modifier and Type | Method and Description |
|---|---|
private static VirtualFile |
createDefaultRoot() |
private static MountHandle |
doMount(FileSystem fileSystem,
VirtualFile mountPoint,
java.io.Closeable... additionalCloseables) |
private static <E> java.util.Set<E> |
emptyRemovableSet() |
static VirtualFile |
getChild(java.lang.String path)
Find a virtual file.
|
static VirtualFile |
getChild(java.net.URI uri)
Find a virtual file.
|
static VirtualFile |
getChild(java.net.URL url)
Deprecated.
use getChild(URI) instead
|
static java.util.List<VirtualFile> |
getChildren()
Get the children
|
static java.util.List<VirtualFile> |
getChildren(VirtualFileFilter filter)
Get the children
|
static java.util.List<VirtualFile> |
getChildrenRecursively()
Get all the children recursively
|
static java.util.List<VirtualFile> |
getChildrenRecursively(VirtualFileFilter filter)
Get all the children recursively
|
(package private) static VFS.Mount |
getMount(VirtualFile virtualFile) |
static VirtualFile |
getRootVirtualFile()
Get the root virtual file for this VFS instance.
|
(package private) static java.util.Set<java.lang.String> |
getSubmounts(VirtualFile virtualFile)
Get all immediate submounts for a path.
|
private static void |
init()
Initialize VFS protocol handlers package property.
|
private static boolean |
isWindows() |
static java.io.Closeable |
mount(VirtualFile mountPoint,
FileSystem fileSystem)
Mount a filesystem on a mount point in the VFS.
|
static java.io.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 java.io.Closeable |
mountReal(java.io.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 java.io.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 java.io.Closeable |
mountZip(java.io.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 java.io.Closeable |
mountZip(java.io.InputStream zipData,
java.lang.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 java.io.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 java.io.Closeable |
mountZipExpanded(java.io.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 java.io.Closeable |
mountZipExpanded(java.io.InputStream zipData,
java.lang.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 java.io.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
|
private static final java.util.concurrent.ConcurrentMap<VirtualFile,java.util.Map<java.lang.String,VFS.Mount>> mounts
private static final VirtualFile rootVirtualFile
private static final VFS.Mount rootMount
private static final java.util.Set EMPTY_REMOVABLE_SET
private static VirtualFile createDefaultRoot()
private static void init()
public static java.io.Closeable mount(VirtualFile mountPoint, FileSystem fileSystem) throws java.io.IOException
mountPoint - the mount pointfileSystem - the file system to mountjava.io.IOException - if an I/O error occurs, such as a filesystem already being mounted at the given mount point@Deprecated public static VirtualFile getChild(java.net.URL url) throws java.net.URISyntaxException
url - the URL whose path component is the child pathjava.lang.IllegalArgumentException - if the path is nulljava.net.URISyntaxException - for any uri errorprivate static boolean isWindows()
public static VirtualFile getChild(java.net.URI uri)
uri - the URI whose path component is the child pathjava.lang.IllegalArgumentException - if the path is nullpublic static VirtualFile getChild(java.lang.String path)
path - the child pathjava.lang.IllegalArgumentException - if the path is nullpublic static VirtualFile getRootVirtualFile()
public static java.util.List<VirtualFile> getChildren() throws java.io.IOException
java.io.IOException - for any problem accessing the virtual file systempublic static java.util.List<VirtualFile> getChildren(VirtualFileFilter filter) throws java.io.IOException
filter - to filter the childrenjava.io.IOException - for any problem accessing the virtual file systempublic static java.util.List<VirtualFile> getChildrenRecursively() throws java.io.IOException
This always uses
VisitorAttributes.RECURSEjava.io.IOException - for any problem accessing the virtual file systempublic static java.util.List<VirtualFile> getChildrenRecursively(VirtualFileFilter filter) throws java.io.IOException
This always uses
VisitorAttributes.RECURSEfilter - to filter the childrenjava.io.IOException - for any problem accessing the virtual file systempublic static void visit(VirtualFileVisitor visitor) throws java.io.IOException
visitor - the visitorjava.io.IOException - for any problem accessing the VFSjava.lang.IllegalArgumentException - if the visitor is nullprotected static void visit(VirtualFile file, VirtualFileVisitor visitor) throws java.io.IOException
file - the filevisitor - the visitorjava.io.IOException - for any problem accessing the VFSjava.lang.IllegalArgumentException - if the file or visitor is nullstatic VFS.Mount getMount(VirtualFile virtualFile)
static java.util.Set<java.lang.String> getSubmounts(VirtualFile virtualFile)
virtualFile - the pathprivate static MountHandle doMount(FileSystem fileSystem, VirtualFile mountPoint, java.io.Closeable... additionalCloseables) throws java.io.IOException
java.io.IOExceptionpublic static java.io.Closeable mountZip(java.io.File zipFile,
VirtualFile mountPoint,
TempFileProvider tempFileProvider)
throws java.io.IOException
zipFile - the zip file to mountmountPoint - the point at which the filesystem should be mountedtempFileProvider - the temporary file providerjava.io.IOException - if an error occurspublic static java.io.Closeable mountZip(java.io.InputStream zipData,
java.lang.String zipName,
VirtualFile mountPoint,
TempFileProvider tempFileProvider)
throws java.io.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 providerjava.io.IOException - if an error occurspublic static java.io.Closeable mountZip(VirtualFile zipFile, VirtualFile mountPoint, TempFileProvider tempFileProvider) throws java.io.IOException
zipFile - a zip file in the VFSmountPoint - the point at which the filesystem should be mountedtempFileProvider - the temporary file providerjava.io.IOException - if an error occurspublic static java.io.Closeable mountReal(java.io.File realRoot,
VirtualFile mountPoint)
throws java.io.IOException
realRoot - the real filesystem rootmountPoint - the point at which the filesystem should be mountedjava.io.IOException - if an error occurspublic static java.io.Closeable mountTemp(VirtualFile mountPoint, TempFileProvider tempFileProvider) throws java.io.IOException
mountPoint - the point at which the filesystem should be mountedtempFileProvider - the temporary file providerjava.io.IOException - if an error occurspublic static java.io.Closeable mountZipExpanded(java.io.File zipFile,
VirtualFile mountPoint,
TempFileProvider tempFileProvider)
throws java.io.IOException
zipFile - the zip file to mountmountPoint - the point at which the filesystem should be mountedtempFileProvider - the temporary file providerjava.io.IOException - if an error occurspublic static java.io.Closeable mountZipExpanded(java.io.InputStream zipData,
java.lang.String zipName,
VirtualFile mountPoint,
TempFileProvider tempFileProvider)
throws java.io.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 providerjava.io.IOException - if an error occurspublic static java.io.Closeable mountZipExpanded(VirtualFile zipFile, VirtualFile mountPoint, TempFileProvider tempFileProvider) throws java.io.IOException
zipFile - a zip file in the VFSmountPoint - the point at which the filesystem should be mountedtempFileProvider - the temporary file providerjava.io.IOException - if an error occurspublic static java.io.Closeable mountAssembly(VirtualFileAssembly assembly, VirtualFile mountPoint) throws java.io.IOException
assembly - an VirtualFileAssembly to mount in the VFSmountPoint - the point at which the filesystem should be mountedjava.io.IOException - if an error occursprivate static <E> java.util.Set<E> emptyRemovableSet()