Package org.jboss.vfs
Class VirtualFileAssembly
- java.lang.Object
-
- org.jboss.vfs.VirtualFileAssembly
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class VirtualFileAssembly extends Object implements Closeable
Assembly of VirtualFiles that can be mounted into the VFS in a structure that is not required to match a real filesystem structure.- Author:
- John Bailey
-
-
Constructor Summary
Constructors Constructor Description VirtualFileAssembly()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(String path, File root)voidadd(String path, VirtualFile virtualFile)Add aVirtualFileto the assembly in a given path.voidadd(VirtualFile virtualFile)Add aVirtualFileto the assembly.voidaddZip(String path, File zipFile)voidclose()Close the assembly and nested resources.booleancontains(VirtualFile mountPoint, VirtualFile target)List<String>getChildNames(VirtualFile mountPoint, VirtualFile target)Returns a list of all the names of the children in the assembly.VirtualFilegetFile(VirtualFile mountPoint, VirtualFile target)Get the VirtualFile from the assembly.
-
-
-
Method Detail
-
add
public void add(VirtualFile virtualFile)
Add aVirtualFileto the assembly.- Parameters:
virtualFile-
-
add
public void add(String path, VirtualFile virtualFile)
Add aVirtualFileto the assembly in a given path.- Parameters:
path-virtualFile-
-
add
public void add(String path, File root) throws IOException
- Throws:
IOException
-
addZip
public void addZip(String path, File zipFile) throws IOException
- Throws:
IOException
-
getFile
public VirtualFile getFile(VirtualFile mountPoint, VirtualFile target)
Get the VirtualFile from the assembly. This will traverse VirtualFiles in assembly to find children if needed.- Parameters:
mountPoint-target-- Returns:
- Throws:
IOException
-
getChildNames
public List<String> getChildNames(VirtualFile mountPoint, VirtualFile target)
Returns a list of all the names of the children in the assembly.- Returns:
-
contains
public boolean contains(VirtualFile mountPoint, VirtualFile target)
-
close
public void close()
Close the assembly and nested resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-