Class NdResourceFile
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.nd.NdStruct
org.aspectj.org.eclipse.jdt.internal.core.nd.NdNode
org.aspectj.org.eclipse.jdt.internal.core.nd.java.NdResourceFile
- All Implemented Interfaces:
IDestructable,INdStruct
Represents a source of java classes (such as a .jar or .class file).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic FieldShortstatic FieldSearchKey<JavaIndex>static intFlag indicating that this is a corrupted zip file.static FieldLongstatic FieldStringstatic FieldLongstatic FieldStringstatic FieldLongstatic FieldLongstatic FieldLongstatic StructDef<NdResourceFile>static FieldOneToMany<NdType>static FieldOneToMany<NdWorkspaceLocation>static FieldList<NdZipEntry> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddZipEntry(String fileName)voidallocateZipEntries(int expectedNumberOfZipEntries)List<org.eclipse.core.runtime.IPath>org.eclipse.core.runtime.IPathgetAnyOpenWorkspaceLocation(org.eclipse.core.resources.IWorkspaceRoot root)org.eclipse.core.runtime.IPathintgetFlags()longReturns the content of the JAR's MANIFEST.MF file, or null if either this isn't a .JAR file or it didn't contain a MANIFEST.MF file.Returns the absolute path to the java root for this .jar or .class file.org.eclipse.core.runtime.IPathgetPath()Returns a workspace path to this resource if possible and the absolute filesystem location if not.longlonglonggetType(int index)intgetTypes()Returns the set of all leaf zip entries that are not .class files.booleanhasAllFlags(int flags)booleanbooleanReturns true iff the indexer has finished writing the contents of this file to the index.booleanDetermines whether this file is still in the index.voidvoidsetFingerprint(FileFingerprint newFingerprint)voidsetFlags(int flags)voidsetJdkLevel(long jdkLevel)voidsetLocation(String filename)voidsetManifestContent(char[] newContent)Stores the content of the JAR's MANIFEST.MF file.voidsetPackageFragmentRoot(char[] javaRoot)voidsetTimeLastUsed(long timeLastUsed)toString()Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.nd.NdNode
delete, destruct, equals, getAddress, getBindingID, getBit, getByte, getNodeId, getNodeType, hashCode, load, load
-
Field Details
-
FILENAME
-
TYPES
-
TIME_LAST_USED
-
TIME_LAST_SCANNED
-
SIZE_LAST_SCANNED
-
HASHCODE_LAST_SCANNED
-
WORKSPACE_MAPPINGS
-
JAVA_ROOT
-
JDK_LEVEL
-
ZIP_ENTRIES
-
MANIFEST_CONTENT
-
FILE_FLAGS
-
FLG_CORRUPT_ZIP_FILE
public static final int FLG_CORRUPT_ZIP_FILEFlag indicating that this is a corrupted zip file.- See Also:
- Constant Field Values
-
type
-
-
Constructor Details
-
NdResourceFile
-
NdResourceFile
-
-
Method Details
-
isCorruptedZipFile
public boolean isCorruptedZipFile() -
getFlags
public int getFlags() -
hasAllFlags
public boolean hasAllFlags(int flags) -
setFlags
public void setFlags(int flags) -
getZipEntries
Returns the set of all leaf zip entries that are not .class files. Does not include non-empty directories or .class files, but will contain all other zip entries from the original jar file. Returns the empty list for non-jar files. -
getManifestContent
Returns the content of the JAR's MANIFEST.MF file, or null if either this isn't a .JAR file or it didn't contain a MANIFEST.MF file. -
setManifestContent
public void setManifestContent(char[] newContent)Stores the content of the JAR's MANIFEST.MF file. This should only be invoked on resources that correspond to JAR files. -
getJdkLevel
public long getJdkLevel() -
setJdkLevel
public void setJdkLevel(long jdkLevel) -
isInIndex
public boolean isInIndex()Determines whether this file is still in the index. If aNdResourceFileinstance is retained while the database lock is released and reobtained, this method should be invoked to ensure that theNdResourceFilehas not been deleted in the meantime. -
getAllWorkspaceLocations
-
getFirstWorkspaceLocation
public org.eclipse.core.runtime.IPath getFirstWorkspaceLocation() -
getAnyOpenWorkspaceLocation
public org.eclipse.core.runtime.IPath getAnyOpenWorkspaceLocation(org.eclipse.core.resources.IWorkspaceRoot root) -
getPath
public org.eclipse.core.runtime.IPath getPath()Returns a workspace path to this resource if possible and the absolute filesystem location if not. -
getWorkspaceMappings
-
getLocation
-
setLocation
-
getFingerprint
-
isDoneIndexing
public boolean isDoneIndexing()Returns true iff the indexer has finished writing the contents of this file to the index. Returns false if indexing may still be going on. If this returns false, readers should ignore all contents of this file.- Returns:
- true iff the contents of this file are usable
-
getTimeLastScanned
public long getTimeLastScanned() -
getSizeLastScanned
public long getSizeLastScanned() -
getTimeLastUsed
public long getTimeLastUsed() -
setTimeLastUsed
public void setTimeLastUsed(long timeLastUsed) -
setFingerprint
-
setPackageFragmentRoot
public void setPackageFragmentRoot(char[] javaRoot) -
getPackageFragmentRoot
Returns the absolute path to the java root for this .jar or .class file. If this is a .jar file, it returns its own filename. -
markAsInvalid
public void markAsInvalid() -
getTypeCount
public int getTypeCount() -
getTypes
-
getType
-
toString
-
allocateZipEntries
public void allocateZipEntries(int expectedNumberOfZipEntries) -
addZipEntry
-