Class ZipFileCodeBaseEntry
- java.lang.Object
-
- edu.umd.cs.findbugs.classfile.impl.AbstractScannableCodeBaseEntry
-
- edu.umd.cs.findbugs.classfile.impl.ZipFileCodeBaseEntry
-
- All Implemented Interfaces:
ICodeBaseEntry
public class ZipFileCodeBaseEntry extends AbstractScannableCodeBaseEntry
Implementation of ICodeBaseEntry for resources in zipfile codebases.- Author:
- David Hovemeyer
-
-
Constructor Summary
Constructors Constructor Description ZipFileCodeBaseEntry(ZipFileCodeBase codeBase, java.util.zip.ZipEntry zipEntry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
ClassDescriptor
getClassDescriptor()
Return the ClassDescriptor of the class resource accessed by this codebase entry.AbstractScannableCodeBase
getCodeBase()
Get the codebase this codebase entry belongs to.int
getNumBytes()
Get the number of bytes in the resource.java.lang.String
getRealResourceName()
int
hashCode()
java.io.InputStream
openResource()
Open an input stream reading from the resource.java.lang.String
toString()
-
Methods inherited from class edu.umd.cs.findbugs.classfile.impl.AbstractScannableCodeBaseEntry
getResourceName, overrideResourceName
-
-
-
-
Constructor Detail
-
ZipFileCodeBaseEntry
public ZipFileCodeBaseEntry(ZipFileCodeBase codeBase, java.util.zip.ZipEntry zipEntry)
-
-
Method Detail
-
getNumBytes
public int getNumBytes()
Description copied from interface:ICodeBaseEntry
Get the number of bytes in the resource. Returns <0 if the number of bytes is not known.- Returns:
- number of bytes in the resource, or <0 if not known.
-
openResource
public java.io.InputStream openResource() throws java.io.IOException
Description copied from interface:ICodeBaseEntry
Open an input stream reading from the resource.- Returns:
- InputStream reading from the resource.
- Throws:
java.io.IOException
- if an error occurs reading from the resource
-
getCodeBase
public AbstractScannableCodeBase getCodeBase()
Description copied from interface:ICodeBaseEntry
Get the codebase this codebase entry belongs to.- Specified by:
getCodeBase
in interfaceICodeBaseEntry
- Specified by:
getCodeBase
in classAbstractScannableCodeBaseEntry
- Returns:
- the codebase this codebase entry belongs to
-
getRealResourceName
public java.lang.String getRealResourceName()
- Specified by:
getRealResourceName
in classAbstractScannableCodeBaseEntry
-
getClassDescriptor
public ClassDescriptor getClassDescriptor()
Description copied from interface:ICodeBaseEntry
Return the ClassDescriptor of the class resource accessed by this codebase entry. Do not call this method unless ClassDescriptor.isClassResource() returns true. This method may require the class data to be loaded in order to determine the class.- Returns:
- ClassDescriptor of this entry
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-