public class VirtualFileAssembly
extends java.lang.Object
implements java.io.Closeable
| Modifier and Type | Class and Description |
|---|---|
private static class |
VirtualFileAssembly.AssemblyNode
Node located within the assembly.
|
private static class |
VirtualFileAssembly.Path
Path representation to hold onto the elements of the path.
|
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<java.io.Closeable> |
mountHandles |
private VirtualFile |
mountRoot |
private static java.util.Random |
RANDOM_NUM_GEN |
private VirtualFileAssembly.AssemblyNode |
rootNode |
private TempFileProvider |
tempFileProvider |
| Constructor and Description |
|---|
VirtualFileAssembly() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.String path,
java.io.File root) |
void |
add(java.lang.String path,
VirtualFile virtualFile)
Add a
VirtualFile to the assembly in a given path. |
void |
add(VirtualFile virtualFile)
Add a
VirtualFile to the assembly. |
void |
addZip(java.lang.String path,
java.io.File zipFile) |
void |
close()
Close the assembly and nested resources.
|
boolean |
contains(VirtualFile mountPoint,
VirtualFile target) |
private java.lang.String |
getAssemblyId() |
java.util.List<java.lang.String> |
getChildNames(VirtualFile mountPoint,
VirtualFile target)
Returns a list of all the names of the children in the assembly.
|
VirtualFile |
getFile(VirtualFile mountPoint,
VirtualFile target)
Get the VirtualFile from the assembly.
|
private TempFileProvider |
getTempFileProvider() |
private static final java.util.Random RANDOM_NUM_GEN
private final VirtualFileAssembly.AssemblyNode rootNode
private final java.util.List<java.io.Closeable> mountHandles
private final VirtualFile mountRoot
private TempFileProvider tempFileProvider
public void add(VirtualFile virtualFile)
VirtualFile to the assembly.virtualFile - public void add(java.lang.String path,
VirtualFile virtualFile)
VirtualFile to the assembly in a given path.path - virtualFile - public void add(java.lang.String path,
java.io.File root)
throws java.io.IOException
java.io.IOExceptionpublic void addZip(java.lang.String path,
java.io.File zipFile)
throws java.io.IOException
java.io.IOExceptionpublic VirtualFile getFile(VirtualFile mountPoint, VirtualFile target)
mountPoint - target - java.io.IOExceptionpublic java.util.List<java.lang.String> getChildNames(VirtualFile mountPoint, VirtualFile target)
public boolean contains(VirtualFile mountPoint, VirtualFile target)
public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableprivate TempFileProvider getTempFileProvider() throws java.io.IOException
java.io.IOExceptionprivate java.lang.String getAssemblyId()