Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.virtual.plugins.context.vfs
Class AssembledDirectory

    java.lang.Object
      org.jboss.virtual.VirtualFile
          org.jboss.virtual.plugins.context.vfs.AssembledDirectory

All Implemented Interfaces:
  java.io.Serializable

    public class AssembledDirectory

extends VirtualFile

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.

Version:
  $Revision: 1.1 $
Author:
  Bill Burke
See Also:
  Serialized Form

Constructor Summary
`AssembledDirectory(VirtualFileHandler handler)`

Method Summary
`VirtualFile` | `addBytes(byte[] bytes, java.lang.String name)` Add raw bytes as a file to this assembled directory
`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.
`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.
`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. what jar or classpath directory it lives in.
`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. what jar or classpath directory it lives in.
`static boolean` | `antMatch(java.lang.String path, java.lang.String expression)` Determine whether a given file path matches an Ant pattern.
`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.

Methods inherited from class org.jboss.virtual.VirtualFile
`close, closeStreams, equals, exists, findChild, getHandler, getChildren, getChildren, getChildrenRecursively, getChildrenRecursively, getLastModified, getName, getParent, getPathName, getSize, getVFS, hasBeenModified, hashCode, isHidden, isLeaf, openStream, toString, toURI, toURL, visit`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### AssembledDirectory

    public AssembledDirectory(VirtualFileHandler handler)

Method Detail

### addClass

    public void addClass(java.lang.Class clazz)

  Find the underlying .class file representing this class and create it within this directory, along with its packages. So, if you added com.acme.Customer class, then a directory structure com/acme would be created and an entry in the acme directory would be the .class file.

  Parameters:
    `clazz` -

### addClass

    public void addClass(java.lang.String className)

  Find the underlying .class file representing this class and create it within this directory, along with its packages. So, if you added com.acme.Customer class, then a directory structure com/acme would be created and an entry in the acme directory would be the .class file.

  Parameters:
    `className` -

### addClass

    public 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. So, if you added com.acme.Customer class, then a directory structure com/acme would be created and an entry in the acme directory would be the .class file.

  Parameters:
    `className` -
    `loader` - ClassLoader to look for class resource

### mkdirs

    public AssembledDirectory mkdirs(java.lang.String path)

  Make any directories for the give path to a file.

  Parameters:
    `path` - must be a path to a file as last element in path does not have a directory created
  Returns:
    directory file will live in

### addResources

    public void addResources(java.lang.Class baseResource,
                             java.lang.String[] includes,
                             java.lang.String[] excludes)

  Locate the .class resource of baseResource. From this resource, determine the base of the resource i.e. what jar or classpath directory it lives in. Once the base of the resource is found, scan all files recursively within the base using the include and exclude patterns. A mirror file structure will be created within this AssembledDirectory. Ths is very useful when you want to create a virtual jar that contains a subset of .class files in your classpath. The include/exclude patterns follow the Ant file pattern matching syntax. See ant.apache.org for more details.

  Parameters:
    `baseResource` -
    `includes` -
    `excludes` -

### addResources

    public 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. what jar or classpath directory it lives in. The Thread.currentThread().getContextClassloader() will be used Once the base of the resource is found, scan all files recursively within the base using the include and exclude patterns. A mirror file structure will be created within this AssembledDirectory. Ths is very useful when you want to create a virtual jar that contains a subset of .class files in your classpath. The include/exclude patterns follow the Ant file pattern matching syntax. See ant.apache.org for more details.

  Parameters:
    `baseResource` -
    `includes` -
    `excludes` -

### addResources

    public 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. what jar or classpath directory it lives in. The loader parameter will be used to find the resource. Once the base of the resource is found, scan all files recursively within the base using the include and exclude patterns. A mirror file structure will be created within this AssembledDirectory. Ths is very useful when you want to create a virtual jar that contains a subset of .class files in your classpath. The include/exclude patterns follow the Ant file pattern matching syntax. See ant.apache.org for more details.

  Parameters:
    `baseResource` -
    `includes` -
    `excludes` -
    `loader` -

### getPattern

    public static java.util.regex.Pattern getPattern(java.lang.String matcher)

  Create a regular expression pattern from an Ant file matching pattern

  Parameters:
    `matcher` -
  Returns:

### antMatch

    public static boolean antMatch(java.lang.String path,
                                   java.lang.String expression)

  Determine whether a given file path matches an Ant pattern.

  Parameters:
    `path` -
    `expression` -
  Returns:

### addChild

    public VirtualFile addChild(VirtualFile vf)

  Add a VirtualFile as a child to this AssembledDirectory.

  Parameters:
    `vf` -

### addChild

    public VirtualFile addChild(VirtualFile vf,
                                java.lang.String newName)

  Add a VirtualFile as a child to this AssembledDirectory. This file will be added under a new aliased name.

  Parameters:
    `vf` -
    `newName` -

### addResource

    public VirtualFile addResource(java.lang.String resource)

  Add a classloader found resource to as a child to this AssembledDirectory. The base file name of the resource will be used as the child's name. Thread.currentThread.getCOntextClassLoader() will be used to load the resource.

  Parameters:
    `resource` -

### addResource

    public VirtualFile addResource(java.lang.String resource,
                                   java.lang.String newName)

  Add a classloader found resource to as a child to this AssembledDirectory. The newName parameter will be used as the name of the child. Thread.currentThread.getCOntextClassLoader() will be used to load the resource.

  Parameters:
    `resource` -
    `newName` -

### addResource

    public VirtualFile addResource(java.lang.String resource,
                                   java.lang.ClassLoader loader)

  Add a classloader found resource to as a child to this AssembledDirectory. The base file name of the resource will be used as the child's name. The loader parameter will be used to load the resource.

  Parameters:
    `resource` -
    `loader` -

### addResource

    public VirtualFile addResource(java.net.URL url)

  Add a resource identified by the URL as a child to this AssembledDirectory.

  Parameters:
    `url` -

### addResource

    public 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. The newName parameter will be used as the name of the child. The loader parameter will be used to load the resource.

  Parameters:
    `resource` -
    `loader` -
    `newName` -

### addBytes

    public VirtualFile addBytes(byte[] bytes,
                                java.lang.String name)

  Add raw bytes as a file to this assembled directory

  Parameters:
    `bytes` -
    `name` -
  Returns:

### mkdir

    public AssembledDirectory mkdir(java.lang.String name)

  Create a directory within this directory.

  Parameters:
    `name` -
  Returns:

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD