public abstract class AArchiveBundleContainerResolver extends AEmbeddableContainerResolver
Modifier and Type | Field and Description |
---|---|
static org.pfsw.file.IZipEntryFilter |
ALL_ZIP_ENTRIES |
SYS_PROP_CONTAINER_ROOT_DIR
Constructor and Description |
---|
AArchiveBundleContainerResolver(IClassSpaceBuilder classSpaceBuilder,
BundleContainerSpecification parentContainerSpec) |
Modifier and Type | Method and Description |
---|---|
protected void |
addContainerForClassesFolder(java.lang.String classesFolder)
Adds a container for the given classes folder inside the archive and adds
all classes in that folder to the container.
|
protected void |
addContainersForJarFiles(java.lang.String libFolder)
Adds a container for each JAR file in the given libFolder.
|
protected java.util.List<java.lang.String> |
collectArchivesFrom(java.util.List<java.lang.String> bundleClasspath) |
protected java.util.List<java.lang.String> |
collectDirNamesFrom(java.util.List<java.lang.String> bundleClasspath) |
protected java.util.Optional<java.nio.file.Path> |
extractToTempFolder(java.io.File zipFile,
org.pfsw.file.IZipEntryFilter filter) |
protected BundleContainerSpecification |
getBundleContainerSpec()
Returns the bundle container specification after it has been initialized
by
initBundle(ClasspathPartDefinition, File) invocation. |
protected abstract org.pfsw.file.IZipEntryFilter |
getBundleExtractFilter()
Returns the filter that specifies which files to extract from the bundle
into a temporary folder.
|
protected abstract java.util.Set<java.lang.String> |
getExtraContainerDirNames()
Returns a set of relative directory path names for which separate containers
will be registered.
|
protected org.pfsw.settings.Settings |
getManifestSettings(java.io.File bundleFile)
Returns the settings from the "MANFIST.MF" in the given bundleFile.
|
protected java.nio.file.Path |
getTempPath()
Returns the path to the temporary directory to which the archive/bundle
has been extracted by the
initBundle(ClasspathPartDefinition, File) method. |
protected java.lang.String |
getValueOrDefault(org.pfsw.settings.Settings settings,
java.lang.String headerName,
java.lang.String defaultValue)
Returns the value of the entry with the given headerName in settings or
the specified defaultValue if not found.
|
protected boolean |
initBundle(ClasspathPartDefinition partDefinition,
java.io.File zipFile)
Initialize this resolver with the archive (zip) file and some optional
parent container data.
|
protected boolean |
isAcceptable(java.lang.String webInfLibFolder,
java.io.File jarFile)
Returns whether or not the given jarFile is acceptable as separate container.
|
protected boolean |
processContainedContainerFile(java.io.File file)
Run another resolver on the given file with the specified relative name.
|
protected void |
setBundleContainerSpec(BundleContainerSpecification bundleContainerSpec) |
createClassContainer, determineContainerFullName, determineContainerQualifiedName, determineRelativeName, getContainerType, getParentContainerSpec, hasParentContainerSpec, resolveContainer
addContainerToClassSpace, appContext, asAbsoluteFile, coll, fileUtil, findOrCreateContainer, getClassSpaceBuilder, getDefinitionFrom, getLogger, getWorkset, setClassSpaceBuilder, str
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
resolveContainers
public AArchiveBundleContainerResolver(IClassSpaceBuilder classSpaceBuilder, BundleContainerSpecification parentContainerSpec)
protected abstract org.pfsw.file.IZipEntryFilter getBundleExtractFilter()
protected abstract java.util.Set<java.lang.String> getExtraContainerDirNames()
protected boolean initBundle(ClasspathPartDefinition partDefinition, java.io.File zipFile)
Subclasses must always call this method first. After this method returns with true
they can analyze the extracted temp folder for more sub-containers.
Then the following methods can be used:
partDefinition
- Contains the full name of the parent or is null.zipFile
- The physical archive file to be analyzed (must not be null).protected java.util.Optional<java.nio.file.Path> extractToTempFolder(java.io.File zipFile, org.pfsw.file.IZipEntryFilter filter)
protected void addContainerForClassesFolder(java.lang.String classesFolder)
classesFolder
- The relative folder name that is supposed to contain *.class files.protected void addContainersForJarFiles(java.lang.String libFolder)
libFolder
- The relative folder name that is supposed to contain *.jar files.protected boolean isAcceptable(java.lang.String webInfLibFolder, java.io.File jarFile)
Example for acceptable JAR: "WEB-INF/lib/sample.jar"
Example for acceptable JAR: "some/folder/sample.jar"
Example for NOT acceptable JAR: "WEB-INF/lib/plugin/sample.jar"
protected boolean processContainedContainerFile(java.io.File file)
file
- The real location on the file system (must not be null).protected org.pfsw.settings.Settings getManifestSettings(java.io.File bundleFile)
protected java.lang.String getValueOrDefault(org.pfsw.settings.Settings settings, java.lang.String headerName, java.lang.String defaultValue)
protected java.util.List<java.lang.String> collectDirNamesFrom(java.util.List<java.lang.String> bundleClasspath)
protected java.util.List<java.lang.String> collectArchivesFrom(java.util.List<java.lang.String> bundleClasspath)
protected java.nio.file.Path getTempPath()
initBundle(ClasspathPartDefinition, File)
method.protected BundleContainerSpecification getBundleContainerSpec()
initBundle(ClasspathPartDefinition, File)
invocation.protected void setBundleContainerSpec(BundleContainerSpecification bundleContainerSpec)