All Implemented Interfaces:
IDestructable, INdStruct

public class NdResourceFile extends NdNode
Represents a source of java classes (such as a .jar or .class file).
  • Field Details

  • Constructor Details

    • NdResourceFile

      public NdResourceFile(Nd dom, long address)
    • NdResourceFile

      public NdResourceFile(Nd nd)
  • Method Details

    • isCorruptedZipFile

      public boolean isCorruptedZipFile()
    • getFlags

      public int getFlags()
    • hasAllFlags

      public boolean hasAllFlags(int flags)
    • setFlags

      public void setFlags(int flags)
    • getZipEntries

      public List<NdZipEntry> 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

      public IString 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 a NdResourceFile instance is retained while the database lock is released and reobtained, this method should be invoked to ensure that the NdResourceFile has not been deleted in the meantime.
    • getAllWorkspaceLocations

      public List<org.eclipse.core.runtime.IPath> 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

      public List<NdWorkspaceLocation> getWorkspaceMappings()
    • getLocation

      public IString getLocation()
    • setLocation

      public void setLocation(String filename)
    • getFingerprint

      public FileFingerprint 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

      public void setFingerprint(FileFingerprint newFingerprint)
    • setPackageFragmentRoot

      public void setPackageFragmentRoot(char[] javaRoot)
    • getPackageFragmentRoot

      public IString 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

      public List<NdType> getTypes()
    • getType

      public NdType getType(int index)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • allocateZipEntries

      public void allocateZipEntries(int expectedNumberOfZipEntries)
    • addZipEntry

      public NdZipEntry addZipEntry(String fileName)