Class ZipInputStreamCodeBase
- java.lang.Object
-
- edu.umd.cs.findbugs.classfile.impl.AbstractScannableCodeBase
-
- edu.umd.cs.findbugs.classfile.impl.ZipInputStreamCodeBase
-
- All Implemented Interfaces:
ICodeBase
,IScannableCodeBase
,java.lang.AutoCloseable
public class ZipInputStreamCodeBase extends AbstractScannableCodeBase
Implementation of ICodeBase to read from a zip file or jar file.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
ZipInputStreamCodeBase.MyIterator
-
Nested classes/interfaces inherited from interface edu.umd.cs.findbugs.classfile.ICodeBase
ICodeBase.Discovered
-
-
Constructor Summary
Constructors Constructor Description ZipInputStreamCodeBase(ICodeBaseLocator codeBaseLocator, java.io.File file)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) ZipInputStreamCodeBaseEntry
build(java.util.zip.ZipInputStream zis, java.util.zip.ZipEntry ze)
void
close()
This method should be called when done using the code base.java.lang.String
getPathName()
Get the filesystem pathname of this codebase.ICodeBaseIterator
iterator()
Get an iterator over the resources in the this code base.ICodeBaseEntry
lookupResource(java.lang.String resourceName)
Look up a resource in this code base.java.lang.String
toString()
-
Methods inherited from class edu.umd.cs.findbugs.classfile.impl.AbstractScannableCodeBase
addLastModifiedTime, addResourceNameTranslation, containsSourceFiles, getCodeBaseLocator, getHowDiscovered, getLastModifiedTime, isApplicationCodeBase, setApplicationCodeBase, setHowDiscovered, setLastModifiedTime, translateResourceName
-
-
-
-
Field Detail
-
DEBUG
static final boolean DEBUG
- See Also:
- Constant Field Values
-
file
final java.io.File file
-
map
final MapCache<java.lang.String,ZipInputStreamCodeBaseEntry> map
-
entries
final java.util.HashSet<java.lang.String> entries
-
-
Constructor Detail
-
ZipInputStreamCodeBase
public ZipInputStreamCodeBase(ICodeBaseLocator codeBaseLocator, java.io.File file) throws java.io.IOException
Constructor.- Parameters:
codeBaseLocator
- the codebase locator for this codebasefile
- the File containing the zip file (may be a temp file if the codebase was copied from a nested zipfile in another codebase)- Throws:
java.io.IOException
-
-
Method Detail
-
lookupResource
public ICodeBaseEntry lookupResource(java.lang.String resourceName)
Description copied from interface:ICodeBase
Look up a resource in this code base.- Parameters:
resourceName
- name of the resource to look up- Returns:
- ICodeBaseEntry representing the resource or null if the resource cannot be found in this code base
-
build
ZipInputStreamCodeBaseEntry build(java.util.zip.ZipInputStream zis, java.util.zip.ZipEntry ze) throws java.io.IOException
- Throws:
java.io.IOException
-
iterator
public ICodeBaseIterator iterator()
Description copied from interface:IScannableCodeBase
Get an iterator over the resources in the this code base.- Returns:
- ICodeBaseIterator over the resources in the code base
-
getPathName
public java.lang.String getPathName()
Description copied from interface:ICodeBase
Get the filesystem pathname of this codebase.- Returns:
- the filesystem pathname of this codebase, or null if this codebase is not accessible via the filesystem
-
close
public void close()
Description copied from interface:ICodeBase
This method should be called when done using the code base.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-