Package edu.umd.cs.findbugs.classfile
Interface ICodeBaseEntry
- All Known Implementing Classes:
AbstractScannableCodeBaseEntry
,DelegatingCodeBaseEntry
,DirectoryCodeBaseEntry
,JrtfsCodeBase.JrtfsCodebaseEntry
,SingleFileCodeBaseEntry
,ZipFileCodeBaseEntry
,ZipInputStreamCodeBaseEntry
public interface ICodeBaseEntry
Object representing a resource in a code base.
- Author:
- David Hovemeyer
-
Method Summary
Modifier and TypeMethodDescriptionReturn the ClassDescriptor of the class resource accessed by this codebase entry.Get the codebase this codebase entry belongs to.int
Get the number of bytes in the resource.Get the name of the resource.Open an input stream reading from the resource.void
overrideResourceName
(String resourceName) Override the resource name of this codebase entry.
-
Method Details
-
getResourceName
String getResourceName()Get the name of the resource.- Returns:
- the name of the resource
-
getNumBytes
int getNumBytes()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
Open an input stream reading from the resource.- Returns:
- InputStream reading from the resource.
- Throws:
IOException
- if an error occurs reading from the resource
-
getCodeBase
ICodeBase getCodeBase()Get the codebase this codebase entry belongs to.- Returns:
- the codebase this codebase entry belongs to
-
getClassDescriptor
ClassDescriptor getClassDescriptor() throws ResourceNotFoundException, InvalidClassFileFormatExceptionReturn 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
- Throws:
ResourceNotFoundException
- InvalidClassFileFormatException if the codebase entry does not reference a valid classfileIllegalArgumentException
- if the codebase entry's filename is definitely not a classfileInvalidClassFileFormatException
-
overrideResourceName
Override the resource name of this codebase entry.- Parameters:
resourceName
- the new resource name
-