|
||||||||||
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,
java.lang.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,
java.lang.String newName)
Add a VirtualFile as a child to this AssembledDirectory. |
void |
addClass(java.lang.Class<?> clazz)
Find the underlying .class file representing this class and create it within this directory, along with its packages. |
void |
addClass(java.lang.String className)
Find the underlying .class file representing this class and create it within this directory, along with its packages. |
void |
addClass(java.lang.String className,
java.lang.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(java.lang.String resource)
Add a classloader found resource to as a child to this AssembledDirectory. |
VirtualFile |
addResource(java.lang.String resource,
java.lang.ClassLoader loader)
Add a classloader found resource to as a child to this AssembledDirectory. |
VirtualFile |
addResource(java.lang.String resource,
java.lang.ClassLoader loader,
java.lang.String newName)
Add a classloader found resource to as a child to this AssembledDirectory. |
VirtualFile |
addResource(java.lang.String resource,
java.lang.String newName)
Add a classloader found resource to as a child to this AssembledDirectory. |
VirtualFile |
addResource(java.net.URL url)
Add a resource identified by the URL as a child to this AssembledDirectory. |
void |
addResources(java.lang.Class<?> baseResource,
java.lang.String[] includes,
java.lang.String[] excludes)
Locate the .class resource of baseResource. |
void |
addResources(java.lang.String baseResource,
java.lang.String[] includes,
java.lang.String[] excludes)
From the baseResource, determine the base of that resource i.e. |
void |
addResources(java.lang.String baseResource,
java.lang.String[] includes,
java.lang.String[] excludes,
java.lang.ClassLoader loader)
From the baseResource, determine the base of that resource i.e. |
static boolean |
antMatch(java.lang.String path,
java.lang.String expression)
Determine whether a given file path matches an Ant pattern. |
void |
cleanup()
Do file cleanup. |
void |
clear()
Clear directory. |
static AssembledDirectory |
createAssembledDirectory(java.lang.String name,
java.lang.String rootName)
Create assembled directory. |
boolean |
equals(java.lang.Object obj)
|
static java.util.regex.Pattern |
getPattern(java.lang.String matcher)
Create a regular expression pattern from an Ant file matching pattern |
AssembledDirectory |
mkdir(java.lang.String name)
Create a directory within this directory. |
AssembledDirectory |
mkdirs(java.lang.String path)
Make any directories for the give path to a file. |
void |
remove(java.lang.String path)
Remove path. |
static void |
removeAssembledDirectory(AssembledDirectory directory)
Remove assembled directory. |
protected static void |
removeDirectory(AssembledDirectory directory)
Remove directory, w/o check. |
Methods inherited from class org.jboss.virtual.VirtualFile |
---|
checkStreams, close, closeStreams, delete, delete, exists, findChild, getCertificates, 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(java.lang.String name, java.lang.String rootName) throws java.io.IOException, java.net.URISyntaxException
name
- context's namerootName
- root name
java.io.IOException
- for any IO error
java.net.URISyntaxException
- for any URI errorpublic static void removeAssembledDirectory(AssembledDirectory directory)
directory
- the directory to removeprotected static void removeDirectory(AssembledDirectory directory)
directory
- the directory to removepublic void cleanup()
VirtualFile
cleanup
in class VirtualFile
public void addPath(VirtualFile root) throws java.io.IOException
root
- the root
java.io.IOException
- for any errorpublic void addPath(VirtualFile root, VirtualFileFilter recurseFilter) throws java.io.IOException
root
- the rootrecurseFilter
- the recurse filter
java.io.IOException
- for any errorpublic void addClass(java.lang.Class<?> clazz)
clazz
- the classpublic void addClass(java.lang.String className)
className
- the class namepublic void addClass(java.lang.String className, java.lang.ClassLoader loader)
className
- the class nameloader
- ClassLoader to look for class resourcepublic AssembledDirectory mkdirs(java.lang.String path)
path
- must be a path to a file as last element in path does not have a directory created
public void addResources(java.lang.Class<?> baseResource, java.lang.String[] includes, java.lang.String[] excludes)
baseResource
- the base resourceincludes
- the includesexcludes
- the excludespublic void addResources(java.lang.String baseResource, java.lang.String[] includes, java.lang.String[] excludes)
baseResource
- the base resourceincludes
- the includesexcludes
- the excludespublic void addResources(java.lang.String baseResource, java.lang.String[] includes, java.lang.String[] excludes, java.lang.ClassLoader loader)
baseResource
- the base resourceincludes
- the includesexcludes
- the excludesloader
- the loaderpublic static java.util.regex.Pattern getPattern(java.lang.String matcher)
matcher
- the matcher pattern
public static boolean antMatch(java.lang.String path, java.lang.String expression)
path
- the pathexpression
- the expression
public VirtualFile addChild(VirtualFile vf)
vf
- the virtual file
public VirtualFile addChild(VirtualFile vf, java.lang.String newName)
vf
- the virtual filenewName
- the new name
public VirtualFile addResource(java.lang.String resource)
resource
- the resource
public VirtualFile addResource(java.lang.String resource, java.lang.String newName)
resource
- the resourcenewName
- the new name
public VirtualFile addResource(java.lang.String resource, java.lang.ClassLoader loader)
resource
- the resourceloader
- the loader
public VirtualFile addResource(java.net.URL url)
url
- the url
public VirtualFile addResource(java.lang.String resource, java.lang.ClassLoader loader, java.lang.String newName)
resource
- the resourceloader
- the loadernewName
- the new name
public VirtualFile addBytes(byte[] bytes, java.lang.String name)
bytes
- the bytesname
- the name
public AssembledDirectory mkdir(java.lang.String name)
name
- the name
public void remove(java.lang.String path)
path
- the path to removepublic void clear()
public boolean equals(java.lang.Object obj)
equals
in class VirtualFile
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |