OPS4J Pax Swissbox :: Extender 1.3.1-redhat-1

org.ops4j.pax.swissbox.extender
Class BundleEntryScanner<T>

java.lang.Object
  extended by org.ops4j.pax.swissbox.extender.BundleEntryScanner<T>
All Implemented Interfaces:
BundleScanner<T>
Direct Known Subclasses:
BundleURLEntryScanner

public abstract class BundleEntryScanner<T>
extends Object
implements BundleScanner<T>

Scans bundles for entries such as directories of files. The bundle entry scanner is abstract in order to allow subclasses to create specific resources out of the found urls.

Since:
0.1.0, October 14, 2007
Author:
Alin Dreghiciu

Constructor Summary
BundleEntryScanner(String path, String filePattern, boolean recurse)
          Creates a bundle entry scanner that scans all entries from a bundle starting form the root path specified without looking for bundle manifest headers.
BundleEntryScanner(String pathManifestHeader, String filePatternManifestHeader, String recurseManifestHeader, String path, String filePattern, boolean recurse)
          Creates a bundle entry scanner that scans all entries from a bundle starting form the root path specified.
 
Method Summary
protected  String getFilePattern(org.osgi.framework.Bundle bundle)
          Returns the file pattern to be searched by first looking for an entry in the manifest of the bundle specified by file pattern manifest header.
protected  String getPath(org.osgi.framework.Bundle bundle)
          Returns the path to be searched by first looking for an entry in the manifest of the bundle specified by path manifest header.
protected  boolean getRecurse(org.osgi.framework.Bundle bundle)
          Returns the recurse by first looking for an entry in the manifest of the bundle specified by recurse manifest header.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ops4j.pax.swissbox.extender.BundleScanner
scan
 

Constructor Detail

BundleEntryScanner

public BundleEntryScanner(String path,
                          String filePattern,
                          boolean recurse)
Creates a bundle entry scanner that scans all entries from a bundle starting form the root path specified without looking for bundle manifest headers.

Parameters:
path - The path name in which to look. A specified path of "/" indicates the root of the bundle. Path is relative to the root of the bundle. If the path is null then it is considered to be root of the bundle.
filePattern - The file name pattern for selecting entries in the specified path. The pattern is only matched against the last element of the entry path and it supports sub-string matching, as specified in the Filter specification, using the wild-card character ("*"). If null is specified, this is equivalent to "*" and matches all files.
recurse - If true, recurse into sub-directories. Otherwise only return entries from the given directory
See Also:
BundleEntryScanner(String, String, String, String, String, boolean)

BundleEntryScanner

public BundleEntryScanner(String pathManifestHeader,
                          String filePatternManifestHeader,
                          String recurseManifestHeader,
                          String path,
                          String filePattern,
                          boolean recurse)
Creates a bundle entry scanner that scans all entries from a bundle starting form the root path specified. The path / filePattern / recurse can be specified in the manifest of the bundle. The provided path / filePattern / recurse are used as defaults if there are no corresponding manifest headers.

Parameters:
pathManifestHeader - name of the manifest header for path
filePatternManifestHeader - name of the manifest header for file pattern
recurseManifestHeader - name of the manifest header for recurse
path - The path name in which to look. A specified path of "/" indicates the root of the bundle. Path is relative to the root of the bundle. If the path is null then it is considered to be root of the bundle.
filePattern - The file name pattern for selecting entries in the specified path. The pattern is only matched against the last element of the entry path and it supports sub-string matching, as specified in the Filter specification, using the wild-card character ("*"). If null is specified, this is equivalent to "*" and matches all files.
recurse - If true, recurse into sub-directories. Otherwise only return entries from the given directory
See Also:
Bundle.findEntries(String, String, boolean)
Method Detail

getPath

protected String getPath(org.osgi.framework.Bundle bundle)
Returns the path to be searched by first looking for an entry in the manifest of the bundle specified by path manifest header. It will return the default path if: - path manifest header is null - header is not set - header is not a string - header is empty

Parameters:
bundle - bundle containing the manifest
Returns:
found path

getFilePattern

protected String getFilePattern(org.osgi.framework.Bundle bundle)
Returns the file pattern to be searched by first looking for an entry in the manifest of the bundle specified by file pattern manifest header. It will return the default file pattern if: - file pattern manifest header is null - header is not set - header is not a string - header is empty

Parameters:
bundle - bundle containing the manifest
Returns:
found file pattern

getRecurse

protected boolean getRecurse(org.osgi.framework.Bundle bundle)
Returns the recurse by first looking for an entry in the manifest of the bundle specified by recurse manifest header. It will return the default recurse if: - file pattern manifest header is null - header is not set - header is not a string - header is not true or false (case insensitive) - header is empty

Parameters:
bundle - bundle containing the manifest
Returns:
found file pattern

toString

public String toString()
Overrides:
toString in class Object

OPS4J Pax Swissbox :: Extender 1.3.1-redhat-1

Copyright © 2006-2011 OPS4J - Open Participation Software for Java. All Rights Reserved.