Package org.jboss.vfs
Class VirtualFileAssembly
java.lang.Object
org.jboss.vfs.VirtualFileAssembly
- All Implemented Interfaces:
Closeable
,AutoCloseable
Assembly of VirtualFiles that can be mounted into the VFS in a structure
that is not required to match a real filesystem structure.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Node located within the assembly.private static class
Path representation to hold onto the elements of the path. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final VirtualFile
private static final Random
private final VirtualFileAssembly.AssemblyNode
private TempFileProvider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
add
(String path, VirtualFile virtualFile) Add aVirtualFile
to the assembly in a given path.void
add
(VirtualFile virtualFile) Add aVirtualFile
to the assembly.void
void
close()
Close the assembly and nested resources.boolean
contains
(VirtualFile mountPoint, VirtualFile target) private String
getChildNames
(VirtualFile mountPoint, VirtualFile target) Returns a list of all the names of the children in the assembly.getFile
(VirtualFile mountPoint, VirtualFile target) Get the VirtualFile from the assembly.private TempFileProvider
-
Field Details
-
RANDOM_NUM_GEN
-
rootNode
-
mountHandles
-
mountRoot
-
tempFileProvider
-
-
Constructor Details
-
VirtualFileAssembly
public VirtualFileAssembly()
-
-
Method Details
-
add
Add aVirtualFile
to the assembly.- Parameters:
virtualFile
-
-
add
Add aVirtualFile
to the assembly in a given path.- Parameters:
path
-virtualFile
-
-
add
- Throws:
IOException
-
addZip
- Throws:
IOException
-
getFile
Get the VirtualFile from the assembly. This will traverse VirtualFiles in assembly to find children if needed.- Parameters:
mountPoint
-target
-- Returns:
- Throws:
IOException
-
getChildNames
Returns a list of all the names of the children in the assembly.- Returns:
-
contains
-
close
public void close()Close the assembly and nested resources.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getTempFileProvider
- Returns:
- Throws:
IOException
-
getAssemblyId
-