Class ZipFileScannerPlugin
java.lang.Object
com.buschmais.jqassistant.plugin.common.api.scanner.AbstractScannerPlugin<I,D>
com.buschmais.jqassistant.plugin.common.api.scanner.AbstractResourceScannerPlugin<I,D>
com.buschmais.jqassistant.plugin.common.api.scanner.AbstractContainerScannerPlugin<ZipFileResource,org.apache.commons.compress.archivers.zip.ZipArchiveEntry,ZipArchiveDescriptor>
com.buschmais.jqassistant.plugin.common.impl.scanner.ZipFileScannerPlugin
- All Implemented Interfaces:
ScannerPlugin<ZipFileResource,,ZipArchiveDescriptor> com.buschmais.jqassistant.core.shared.lifecycle.ContextualConfigurableLifecycleAware<ScannerContext,,Map<String, Object>> com.buschmais.jqassistant.core.shared.lifecycle.LifecycleAware
public class ZipFileScannerPlugin
extends AbstractContainerScannerPlugin<ZipFileResource,org.apache.commons.compress.archivers.zip.ZipArchiveEntry,ZipArchiveDescriptor>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.buschmais.jqassistant.core.scanner.api.ScannerPlugin
ScannerPlugin.Requires -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepts(ZipFileResource item, String path, Scope scope) protected voidenterContainer(ZipFileResource zipFile, ZipArchiveDescriptor archiveDescriptor, ScannerContext context) Create a scope depending on the container type, e.g. a JAR file should return classpath scope.protected ZipArchiveDescriptorgetContainerDescriptor(ZipFileResource zipFile, ScannerContext scannerContext) Return the descriptor representing the artifact.protected StringgetContainerPath(ZipFileResource container, String path) Return the normalized path to the container.protected Iterable<? extends org.apache.commons.compress.archivers.zip.ZipArchiveEntry>getEntries(ZipFileResource container) Return an iterable which delivers the entries of the container.protected ResourcegetEntry(ZipFileResource container, org.apache.commons.compress.archivers.zip.ZipArchiveEntry entry) Return aResourcerepresenting an entry.protected StringgetRelativePath(ZipFileResource container, org.apache.commons.compress.archivers.zip.ZipArchiveEntry entry) Return the relative path of an element within the container.Class<? extends ZipFileResource>getType()protected voidleaveContainer(ZipFileResource zipFile, ZipArchiveDescriptor archiveDescriptor, ScannerContext scannerContext) Destroy the container dependent scope.Methods inherited from class com.buschmais.jqassistant.plugin.common.api.scanner.AbstractContainerScannerPlugin
scanMethods inherited from class com.buschmais.jqassistant.plugin.common.api.scanner.AbstractScannerPlugin
configure, configure, equals, getBooleanProperty, getDirectoryPath, getName, getProperties, getProperty, getScannerContext, getStringProperty, getTypeParameter, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.buschmais.jqassistant.core.scanner.api.ScannerPlugin
destroy, initialize
-
Constructor Details
-
ZipFileScannerPlugin
public ZipFileScannerPlugin()
-
-
Method Details
-
getType
- Specified by:
getTypein interfaceScannerPlugin<ZipFileResource,ZipArchiveDescriptor> - Overrides:
getTypein classAbstractResourceScannerPlugin<ZipFileResource,ZipArchiveDescriptor>
-
getDescriptorType
- Specified by:
getDescriptorTypein interfaceScannerPlugin<ZipFileResource,ZipArchiveDescriptor> - Overrides:
getDescriptorTypein classAbstractResourceScannerPlugin<ZipFileResource,ZipArchiveDescriptor>
-
accepts
- Throws:
IOException
-
getContainerDescriptor
protected ZipArchiveDescriptor getContainerDescriptor(ZipFileResource zipFile, ScannerContext scannerContext) Description copied from class:AbstractContainerScannerPluginReturn the descriptor representing the artifact.- Specified by:
getContainerDescriptorin classAbstractContainerScannerPlugin<ZipFileResource,org.apache.commons.compress.archivers.zip.ZipArchiveEntry, ZipArchiveDescriptor> - Parameters:
zipFile- The container.scannerContext- The scanner context.- Returns:
- The artifact descriptor.
-
getEntries
protected Iterable<? extends org.apache.commons.compress.archivers.zip.ZipArchiveEntry> getEntries(ZipFileResource container) throws IOException Description copied from class:AbstractContainerScannerPluginReturn an iterable which delivers the entries of the container.The entries must not contain the relative root element, i.e. "/".
- Specified by:
getEntriesin classAbstractContainerScannerPlugin<ZipFileResource,org.apache.commons.compress.archivers.zip.ZipArchiveEntry, ZipArchiveDescriptor> - Parameters:
container- The container.- Returns:
- The iterable of entries.
- Throws:
IOException- If the entries cannot be determined.
-
getContainerPath
Description copied from class:AbstractContainerScannerPluginReturn the normalized path to the container.- Specified by:
getContainerPathin classAbstractContainerScannerPlugin<ZipFileResource,org.apache.commons.compress.archivers.zip.ZipArchiveEntry, ZipArchiveDescriptor> - Parameters:
container- The container.- Returns:
- The normalized path.
-
getRelativePath
protected String getRelativePath(ZipFileResource container, org.apache.commons.compress.archivers.zip.ZipArchiveEntry entry) Description copied from class:AbstractContainerScannerPluginReturn the relative path of an element within the container.The following conditions must be considered:
- The separator to use is "/".
- The path must start with "/".
- The path must not end with "/".
- Specified by:
getRelativePathin classAbstractContainerScannerPlugin<ZipFileResource,org.apache.commons.compress.archivers.zip.ZipArchiveEntry, ZipArchiveDescriptor> - Parameters:
container- The container.entry- The entry.- Returns:
- The relative path.
-
enterContainer
protected void enterContainer(ZipFileResource zipFile, ZipArchiveDescriptor archiveDescriptor, ScannerContext context) throws IOException Description copied from class:AbstractContainerScannerPluginCreate a scope depending on the container type, e.g. a JAR file should return classpath scope.- Specified by:
enterContainerin classAbstractContainerScannerPlugin<ZipFileResource,org.apache.commons.compress.archivers.zip.ZipArchiveEntry, ZipArchiveDescriptor> - Parameters:
zipFile- The container.archiveDescriptor- The container descriptor.context- The scanner context.- Throws:
IOException
-
leaveContainer
protected void leaveContainer(ZipFileResource zipFile, ZipArchiveDescriptor archiveDescriptor, ScannerContext scannerContext) throws IOException Description copied from class:AbstractContainerScannerPluginDestroy the container dependent scope.- Specified by:
leaveContainerin classAbstractContainerScannerPlugin<ZipFileResource,org.apache.commons.compress.archivers.zip.ZipArchiveEntry, ZipArchiveDescriptor> - Parameters:
zipFile- The container.archiveDescriptor- The container descriptorscannerContext- The scanner context.- Throws:
IOException
-
getEntry
protected Resource getEntry(ZipFileResource container, org.apache.commons.compress.archivers.zip.ZipArchiveEntry entry) Description copied from class:AbstractContainerScannerPluginReturn aResourcerepresenting an entry.- Specified by:
getEntryin classAbstractContainerScannerPlugin<ZipFileResource,org.apache.commons.compress.archivers.zip.ZipArchiveEntry, ZipArchiveDescriptor> - Parameters:
container- The container.entry- The entry.- Returns:
- The
FileResource.
-