java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.util.JRTUtil

public class JRTUtil extends Object
  • Felddetails

    • DISABLE_CACHE

      public static final boolean DISABLE_CACHE
    • PROPAGATE_IO_ERRORS

      public static final boolean PROPAGATE_IO_ERRORS
    • JAVA_BASE

      public static final String JAVA_BASE
    • JAVA_BASE_CHAR

      public static final char[] JAVA_BASE_CHAR
    • JRT_FS_JAR

      public static final String JRT_FS_JAR
      Siehe auch:
    • NOTIFY_FILES

      public static final int NOTIFY_FILES
      Siehe auch:
    • NOTIFY_PACKAGES

      public static final int NOTIFY_PACKAGES
      Siehe auch:
    • NOTIFY_MODULES

      public static final int NOTIFY_MODULES
      Siehe auch:
    • NOTIFY_ALL

      public static final int NOTIFY_ALL
      Siehe auch:
  • Konstruktordetails

    • JRTUtil

      public JRTUtil()
  • Methodendetails

    • getJrtSystem

      public static org.aspectj.org.eclipse.jdt.internal.compiler.util.JrtFileSystem getJrtSystem(File image)
      Veraltet.
      Parameter:
      image - the path to the root of the JRE whose libraries we are interested in.
      Gibt zurück:
      may return null
    • getJrtSystem

      public static org.aspectj.org.eclipse.jdt.internal.compiler.util.JrtFileSystem getJrtSystem(File image, String release) throws IOException
      Parameter:
      image - the path to the root of the JRE whose libraries we are interested in.
      release - --release version
      Löst aus:
      IOException
    • getJarFileSystem

      public static FileSystem getJarFileSystem(Path path) throws IOException
      Convenient method to get access to the given archive as a FileSystem.

      Note: if the file system for given archive was already created before, the method will reuse existing file system, otherwise a new FileSystem object will be created.

      The caller should not close returned FileSystem as it might be shared with others.

      Parameter:
      path - absolute file path to a jar archive
      Gibt zurück:
      never null
      Löst aus:
      IOException
    • getCtSym

      public static CtSym getCtSym(Path jdkHome) throws IOException
      Löst aus:
      IOException
    • reset

      public static void reset()
      TEST ONLY (use when changing the "modules.to.load" property).
    • walkModuleImage

      public static void walkModuleImage(File image, JRTUtil.JrtFileVisitor<Path> visitor, int notify) throws IOException
      Given the path of a modular image file, this method walks the archive content and notifies the supplied visitor about packages and files visited. The file system contains the following top level directories: /modules/$MODULE/$PATH /packages/$PACKAGE/$MODULE The latter provides quick look up of the module that contains a particular package. However, this method only notifies its clients of the entries within the modules (former) sub-directory. Clients can decide which notifications they want to receive. See NOTIFY_ALL, NOTIFY_FILES, NOTIFY_PACKAGES and NOTIFY_MODULES.
      Parameter:
      image - a java.io.File handle to the JRT image.
      visitor - an instance of JrtFileVisitor to be notified of the entries in the JRT image.
      notify - flag indicating the notifications the client is interested in.
      Löst aus:
      IOException
    • walkModuleImage

      public static void walkModuleImage(File image, String release, JRTUtil.JrtFileVisitor<Path> visitor, int notify) throws IOException
      Löst aus:
      IOException
    • getContentFromJrt

      public static InputStream getContentFromJrt(File jrt, String fileName, String module) throws IOException
      Löst aus:
      IOException
    • getClassfileContent

      public static byte[] getClassfileContent(File jrt, String fileName, String module) throws IOException
      Löst aus:
      IOException
    • getClassfile

      public static ClassFileReader getClassfile(File jrt, String fileName, String module) throws IOException, ClassFormatException
      Löst aus:
      IOException
      ClassFormatException
    • getClassfile

      public static ClassFileReader getClassfile(File jrt, String fileName, String module, Predicate<String> moduleNameFilter) throws IOException, ClassFormatException
      Löst aus:
      IOException
      ClassFormatException
    • getModulesDeclaringPackage

      public static List<String> getModulesDeclaringPackage(File jrt, String qName, String moduleName)
    • hasCompilationUnit

      public static boolean hasCompilationUnit(File jrt, String qualifiedPackageName, String moduleName)
    • sanitizedFileName

      public static String sanitizedFileName(Path path)
    • safeReadBytes

      public static byte[] safeReadBytes(Path path) throws IOException
      Tries to read all bytes of the file denoted by path, returns null if the file could not be found or if the read was interrupted.
      Parameter:
      path -
      Gibt zurück:
      bytes or null
      Löst aus:
      IOException - any IO exception other than NoSuchFileException
    • getJdkRelease

      public static String getJdkRelease(File image) throws IOException
      Parameter:
      image - jrt file path
      Gibt zurück:
      JDK release corresponding to given jrt file, read from "release" file, if available. May return null.
      Löst aus:
      IOException