Package org.apache.torque.generator.configuration

# Class PackageResources

java.lang.Object
org.apache.torque.generator.configuration.PackageResources

public class PackageResources extends Object
A Container of resources which contain a specific package.

Version:
  $Id: $

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PackageResources(String packageToFind, ClassLoader classLoader)`
  Constructor, finds the resources for a certain package.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Collection<String>`
  `getAllResourcesEndingWith(String suffix, boolean recurse)`
  Returns all resource names in the package ending with the defined suffix.
  `List<File>`
  `getDirectories()`
  Returns all directories containing the desired package.
  `List<JarFile>`
  `getJarFiles()`
  Returns all jar files containing the desired package.
  `boolean`
  `isEmpty()`
  Returns whether the queried package exists in the class path.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### PackageResources

    public PackageResources(String packageToFind, ClassLoader classLoader) throws ConfigurationException
    Constructor, finds the resources for a certain package.
    Parameters:
      `packageToFind` - the path to the package, using / or \\ as path separator.
      `classLoader` - the class loader to use.
    Throws:
      `ConfigurationException` - when accessing the class path fails.

- ## Method Details

  - ### getJarFiles

    public List<JarFile> getJarFiles()
    Returns all jar files containing the desired package.
    Returns:
      the jar files, not null.

  - ### getDirectories

    public List<File> getDirectories()
    Returns all directories containing the desired package.
    Returns:
      the directories, not null.

  - ### isEmpty

    public boolean isEmpty()
    Returns whether the queried package exists in the class path.
    Returns:
      true if package does not exist

  - ### getAllResourcesEndingWith

    public Collection<String> getAllResourcesEndingWith(String suffix, boolean recurse)
    Returns all resource names in the package ending with the defined suffix.
    Parameters:
      `suffix` - the suffix which the resource name must have, or null to match every file name.
      `recurse` - true if subpackages should also be searched, false if only the specified package should be searched.
    Returns:
      A collection of resource names with the specified suffix, not null. The contained file names are relative to the scanned package.