|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.virtual.VirtualFile
org.jboss.virtual.AssembledDirectory
public class AssembledDirectory
Extension of VirtualFile that represents a virtual directory that can be composed of arbitrary files and resources spread throughout the file system or embedded in jar files.
| Constructor Summary | |
|---|---|
AssembledDirectory(AssembledDirectoryHandler handler)
|
|
| Method Summary | |
|---|---|
VirtualFile |
addBytes(byte[] bytes,
String name)
Add raw bytes as a file to this assembled directory |
VirtualFile |
addChild(VirtualFile vf)
Add a VirtualFile as a child to this AssembledDirectory. |
VirtualFile |
addChild(VirtualFile vf,
String newName)
Add a VirtualFile as a child to this AssembledDirectory. |
void |
addClass(Class<?> clazz)
Find the underlying .class file representing this class and create it within this directory, along with its packages. |
void |
addClass(String className)
Find the underlying .class file representing this class and create it within this directory, along with its packages. |
void |
addClass(String className,
ClassLoader loader)
Find the underlying .class file representing this class and create it within this directory, along with its packages. |
void |
addPath(VirtualFile root)
Add files recursively from root, using the no jars filter. |
void |
addPath(VirtualFile root,
VirtualFileFilter recurseFilter)
Add files recursively from root, using the filter. |
VirtualFile |
addResource(String resource)
Add a classloader found resource to as a child to this AssembledDirectory. |
VirtualFile |
addResource(String resource,
ClassLoader loader)
Add a classloader found resource to as a child to this AssembledDirectory. |
VirtualFile |
addResource(String resource,
ClassLoader loader,
String newName)
Add a classloader found resource to as a child to this AssembledDirectory. |
VirtualFile |
addResource(String resource,
String newName)
Add a classloader found resource to as a child to this AssembledDirectory. |
VirtualFile |
addResource(URL url)
Add a resource identified by the URL as a child to this AssembledDirectory. |
void |
addResources(Class<?> baseResource,
String[] includes,
String[] excludes)
Locate the .class resource of baseResource. |
void |
addResources(String baseResource,
String[] includes,
String[] excludes)
From the baseResource, determine the base of that resource i.e. |
void |
addResources(String baseResource,
String[] includes,
String[] excludes,
ClassLoader loader)
From the baseResource, determine the base of that resource i.e. |
static boolean |
antMatch(String path,
String expression)
Determine whether a given file path matches an Ant pattern. |
static AssembledDirectory |
createAssembledDirectory(String name,
String rootName)
Create assembled directory. |
static Pattern |
getPattern(String matcher)
Create a regular expression pattern from an Ant file matching pattern |
AssembledDirectory |
mkdir(String name)
Create a directory within this directory. |
AssembledDirectory |
mkdirs(String path)
Make any directories for the give path to a file. |
| Methods inherited from class org.jboss.virtual.VirtualFile |
|---|
checkStreams, cleanup, close, closeStreams, delete, delete, equals, exists, findChild, getChild, getChildren, getChildren, getChildrenRecursively, getChildrenRecursively, getLastModified, getName, getParent, getPathName, getSize, getVFS, hasBeenModified, hashCode, isArchive, isHidden, isLeaf, openStream, toString, toURI, toURL, visit |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AssembledDirectory(AssembledDirectoryHandler handler)
| Method Detail |
|---|
public static AssembledDirectory createAssembledDirectory(String name,
String rootName)
throws IOException,
URISyntaxException
name - context's namerootName - root name
IOException - for any IO error
URISyntaxException - for any URI error
public void addPath(VirtualFile root)
throws IOException
root - the root
IOException - for any error
public void addPath(VirtualFile root,
VirtualFileFilter recurseFilter)
throws IOException
root - the rootrecurseFilter - the recurse filter
IOException - for any errorpublic void addClass(Class<?> clazz)
clazz - the classpublic void addClass(String className)
className - the class name
public void addClass(String className,
ClassLoader loader)
className - the class nameloader - ClassLoader to look for class resourcepublic AssembledDirectory mkdirs(String path)
path - must be a path to a file as last element in path does not have a directory created
public void addResources(Class<?> baseResource,
String[] includes,
String[] excludes)
baseResource - the base resourceincludes - the includesexcludes - the excludes
public void addResources(String baseResource,
String[] includes,
String[] excludes)
baseResource - the base resourceincludes - the includesexcludes - the excludes
public void addResources(String baseResource,
String[] includes,
String[] excludes,
ClassLoader loader)
baseResource - the base resourceincludes - the includesexcludes - the excludesloader - the loaderpublic static Pattern getPattern(String matcher)
matcher - the matcher pattern
public static boolean antMatch(String path,
String expression)
path - the pathexpression - the expression
public VirtualFile addChild(VirtualFile vf)
vf - the virtual file
public VirtualFile addChild(VirtualFile vf,
String newName)
vf - the virtual filenewName - the new name
public VirtualFile addResource(String resource)
resource - the resource
public VirtualFile addResource(String resource,
String newName)
resource - the resourcenewName - the new name
public VirtualFile addResource(String resource,
ClassLoader loader)
resource - the resourceloader - the loader
public VirtualFile addResource(URL url)
url - the url
public VirtualFile addResource(String resource,
ClassLoader loader,
String newName)
resource - the resourceloader - the loadernewName - the new name
public VirtualFile addBytes(byte[] bytes,
String name)
bytes - the bytesname - the name
public AssembledDirectory mkdir(String name)
name - the name
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||