Class AbstractArchiveInputStreamScannerPlugin<S extends org.apache.commons.compress.archivers.ArchiveInputStream,E extends org.apache.commons.compress.archivers.ArchiveEntry,D extends ArchiveDescriptor>
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<S,E,D>
com.buschmais.jqassistant.plugin.common.impl.scanner.AbstractArchiveInputStreamScannerPlugin<S,E,D>
- Type Parameters:
S- The ArchiveInputStream type.E- The ArchiveEntry type.D- The ArchiveDescriptor type.
- All Implemented Interfaces:
ScannerPlugin<S,,D> com.buschmais.jqassistant.core.shared.lifecycle.ContextualConfigurableLifecycleAware<ScannerContext,,Map<String, Object>> com.buschmais.jqassistant.core.shared.lifecycle.LifecycleAware
- Direct Known Subclasses:
TarArchiveInputStreamScannerPlugin
public abstract class AbstractArchiveInputStreamScannerPlugin<S extends org.apache.commons.compress.archivers.ArchiveInputStream,E extends org.apache.commons.compress.archivers.ArchiveEntry,D extends ArchiveDescriptor>
extends AbstractContainerScannerPlugin<S,E,D>
Abstract base class for archive scanners based on commons compress.
-
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 TypeMethodDescriptionbooleanprotected voidenterContainer(S container, D containerDescriptor, ScannerContext scannerContext) Create a scope depending on the container type, e.g. a JAR file should return classpath scope.protected StringgetContainerPath(S container, String path) Return the normalized path to the container.getEntries(S container) Return an iterable which delivers the entries of the container.protected ResourceReturn aResourcerepresenting an entry.protected abstract EgetNextEntry(S container) protected StringgetRelativePath(S container, E entry) Return the relative path of an element within the container.protected voidleaveContainer(S container, D containerDescriptor, ScannerContext scannerContext) Destroy the container dependent scope.Methods inherited from class com.buschmais.jqassistant.plugin.common.api.scanner.AbstractContainerScannerPlugin
getContainerDescriptor, scanMethods inherited from class com.buschmais.jqassistant.plugin.common.api.scanner.AbstractResourceScannerPlugin
getDescriptorType, getTypeMethods 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
-
AbstractArchiveInputStreamScannerPlugin
public AbstractArchiveInputStreamScannerPlugin()
-
-
Method Details
-
getNextEntry
- Throws:
IOException
-
accepts
- Throws:
IOException
-
getEntries
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<S extends org.apache.commons.compress.archivers.ArchiveInputStream,E extends org.apache.commons.compress.archivers.ArchiveEntry, D extends ArchiveDescriptor> - 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<S extends org.apache.commons.compress.archivers.ArchiveInputStream,E extends org.apache.commons.compress.archivers.ArchiveEntry, D extends ArchiveDescriptor> - Parameters:
container- The container.- Returns:
- The normalized path.
-
getRelativePath
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<S extends org.apache.commons.compress.archivers.ArchiveInputStream,E extends org.apache.commons.compress.archivers.ArchiveEntry, D extends ArchiveDescriptor> - Parameters:
container- The container.entry- The entry.- Returns:
- The relative path.
-
enterContainer
protected void enterContainer(S container, D containerDescriptor, ScannerContext scannerContext) 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<S extends org.apache.commons.compress.archivers.ArchiveInputStream,E extends org.apache.commons.compress.archivers.ArchiveEntry, D extends ArchiveDescriptor> - Parameters:
container- The container.containerDescriptor- The container descriptor.scannerContext- The scanner context.- Throws:
IOException
-
leaveContainer
protected void leaveContainer(S container, D containerDescriptor, ScannerContext scannerContext) throws IOException Description copied from class:AbstractContainerScannerPluginDestroy the container dependent scope.- Specified by:
leaveContainerin classAbstractContainerScannerPlugin<S extends org.apache.commons.compress.archivers.ArchiveInputStream,E extends org.apache.commons.compress.archivers.ArchiveEntry, D extends ArchiveDescriptor> - Parameters:
container- The container.containerDescriptor- The container descriptorscannerContext- The scanner context.- Throws:
IOException
-
getEntry
Description copied from class:AbstractContainerScannerPluginReturn aResourcerepresenting an entry.- Specified by:
getEntryin classAbstractContainerScannerPlugin<S extends org.apache.commons.compress.archivers.ArchiveInputStream,E extends org.apache.commons.compress.archivers.ArchiveEntry, D extends ArchiveDescriptor> - Parameters:
container- The container.entry- The entry.- Returns:
- The
FileResource.
-