public class PackageBrowser extends Object
PackageBrowser
class allows browsing both archived and unarchived PEAR
packages, finding package files and directories, loading installation descriptor files and
returning run-time environment settings required for installed components.InstallationDescriptor
Modifier and Type | Field and Description |
---|---|
static String |
BINARY_DIR |
static String |
CONFIGURATION_DIR |
static String |
DATA_DIR |
static String |
DESCRIPTORS_DIR |
static String |
DOCUMENTATION_DIR |
static String |
INSTALLATION_DESCRIPTOR_FILE |
static String |
LIBRARY_DIR |
static String |
METADATA_DIR |
static String |
PEAR_PROPERTIES_FILE |
static String |
RESOURCES_DIR |
static String |
SETENV_TXT_FILE |
static String |
SOURCES_DIR |
static String |
SUBMISSION_PROPERTIES_FILE |
Constructor and Description |
---|
PackageBrowser(File pearPackageDir)
Constructor that allows browsing a given unacrhived PEAR package before or after its
installation.
|
PackageBrowser(JarFile pearPackage)
Constructor that allows browsing a given PEAR package without unarchiving it.
|
Modifier and Type | Method and Description |
---|---|
String |
buildComponentClassPath()
Creates a string that should be added to the CLASSPATH to run the given installed component,
based on its installation descriptor specifications, as well as the contents of its
lib directory. |
String |
buildComponentClassPath(boolean relativePath,
boolean addLibDir)
Creates a string that should be added to the CLASSPATH to run the given installed component,
based on its installation descriptor specifications, as well as the contents of its
lib directory. |
String |
buildComponentPath()
Creates a string that should be added to the PATH to run the given installed component, based
on the PEAR package defaults and its installation descriptor specifications.
|
String |
buildComponentPath(boolean relativePath)
Creates a string that should be added to the PATH to run the given installed component, based
on the PEAR package defaults and its installation descriptor specifications.
|
String |
buildComponentRuntimeClassPath()
Like
buildComponentClassPath() , but without all jars from the lib dir. |
File[] |
findDirectory(String dirNamePattern)
Looks for package directories matching a given directory name pattern in the PEAR package.
|
File[] |
findFile(String fileNamePattern)
Looks for package files matching a given file name pattern in the PEAR package.
|
File |
findStandardDirectory(String stdDirName)
Looks for a given standard package directory.
|
File |
findStandardFile(String stdFileName)
Looks for a given standard package file.
|
File[] |
getAllDirectories() |
File[] |
getAllFiles() |
String |
getComponentDataPath()
Returns the UIMA datapath setting for the component.
|
Properties |
getComponentEnvVars()
Returns the environment variable settings for the component.
|
String |
getComponentPearDescPath()
returns the pear component pearSpecifier file path.
|
InstallationDescriptor |
getInstallationDescriptor()
Loads the
INSTALLATION_DESCRIPTOR_FILE file, and creates the
InstallationDescriptor (InsD) object. |
File |
getRootDirectory() |
boolean |
isArchived() |
public static final String BINARY_DIR
public static final String CONFIGURATION_DIR
public static final String DATA_DIR
public static final String DESCRIPTORS_DIR
public static final String DOCUMENTATION_DIR
public static final String LIBRARY_DIR
public static final String METADATA_DIR
public static final String RESOURCES_DIR
public static final String SOURCES_DIR
public static final String INSTALLATION_DESCRIPTOR_FILE
public static final String PEAR_PROPERTIES_FILE
public static final String SUBMISSION_PROPERTIES_FILE
public static final String SETENV_TXT_FILE
public PackageBrowser(JarFile pearPackage) throws IOException
pearPackage
- The given archived PEAR package to browse.IOException
- if a problem with IOpublic PackageBrowser(File pearPackageDir) throws IOException
pearPackageDir
- The root directory where the PEAR package was unarchived.IOException
- if a problem with IOpublic String buildComponentClassPath() throws IOException
lib
directory. The output string includes absolute path expressions for all
relevant objects containing in the component PEAR package. If the component package is
archived, returns null
.IOException
- If any I/O exception occurred.public String buildComponentRuntimeClassPath() throws IOException
buildComponentClassPath()
, but without all jars from the lib dir.IOException
- if there was an IO problempublic String buildComponentClassPath(boolean relativePath, boolean addLibDir) throws IOException
lib
directory. The output string includes absolute or relative path expressions
for all relevant objects containing in the component PEAR package, depending on the value of a
given boolean
argument. If the component package is archived, returns
null
.relativePath
- If true
, the output string will include relative path expressions for
all relevant objects containing in the component PEAR package, otherwise it will
contain absolute path expressions for these objects.addLibDir
- Whether to add jars from the lib dir to the classpath (true at packaging time, false
at runtime).IOException
- If any I/O exception occurred.public String buildComponentPath() throws IOException
null
.IOException
- If any I/O exception occurred.public String buildComponentPath(boolean relativePath) throws IOException
boolean
argument. If
the component package is archived, returns null
.relativePath
- If true
, the output string will include relative path expressions for
all relevant objects containing in the component PEAR package, otherwise it will
contain absolute path expressions for these objects.IOException
- If any I/O exception occurred.public File[] findDirectory(String dirNamePattern)
dirNamePattern
- The given directory name pattern to look for.public File[] findFile(String fileNamePattern)
fileNamePattern
- The given file name pattern to look for.public File findStandardDirectory(String stdDirName)
stdDirName
- The given full standard package directory name.null
otherwise.public File findStandardFile(String stdFileName)
stdFileName
- The given full standard package file name.null
otherwise.public File[] getAllDirectories()
File
objects representing all directories existing in the
package.public File[] getAllFiles()
File
objects representing all files existing in the package.public InstallationDescriptor getInstallationDescriptor() throws IOException
INSTALLATION_DESCRIPTOR_FILE
file, and creates the
InstallationDescriptor
(InsD) object. Note: if the component package has
been installed, the InsD object contains real specifications of package directories, otherwise
it may contain macros like $main_root
.IOException
- If any I/O exception occurred.public File getRootDirectory()
public boolean isArchived()
true
, if the archived package was specified, false
otherwise.public String getComponentPearDescPath() throws IOException
IOException
- if there was an IO problempublic String getComponentDataPath() throws IOException
uima.datapath
.IOException
- If any I/O exception occurred while reading the component meta data.public Properties getComponentEnvVars() throws IOException
classpath
and uima.datapath
settings for the
component.IOException
- If any I/O exception occurred while reading the component meta data.Copyright © 2006–2021 The Apache Software Foundation. All rights reserved.