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
Modifier and TypeFieldDescriptionstatic FieldShort
static FieldSearchKey<JavaIndex>
static int
Flag indicating that this is a corrupted zip file.static FieldLong
static FieldString
static FieldLong
static FieldString
static FieldLong
static FieldLong
static FieldLong
static StructDef<NdResourceFile>
static FieldOneToMany<NdType>
static FieldOneToMany<NdWorkspaceLocation>
static FieldList<NdZipEntry>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddZipEntry(String fileName)
void
allocateZipEntries(int expectedNumberOfZipEntries)
List<org.eclipse.core.runtime.IPath>
org.eclipse.core.runtime.IPath
getAnyOpenWorkspaceLocation(org.eclipse.core.resources.IWorkspaceRoot root)
org.eclipse.core.runtime.IPath
int
getFlags()
long
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.Returns the absolute path to the java root for this .jar or .class file.org.eclipse.core.runtime.IPath
getPath()
Returns a workspace path to this resource if possible and the absolute filesystem location if not.long
long
long
getType(int index)
int
getTypes()
Returns the set of all leaf zip entries that are not .class files.boolean
hasAllFlags(int flags)
boolean
boolean
Returns true iff the indexer has finished writing the contents of this file to the index.boolean
Determines whether this file is still in the index.void
void
setFingerprint(FileFingerprint newFingerprint)
void
setFlags(int flags)
void
setJdkLevel(long jdkLevel)
void
setLocation(String filename)
void
setManifestContent(char[] newContent)
Stores the content of the JAR's MANIFEST.MF file.void
setPackageFragmentRoot(char[] javaRoot)
void
setTimeLastUsed(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 aNdResourceFile
instance is retained while the database lock is released and reobtained, this method should be invoked to ensure that theNdResourceFile
has 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
-