-
- All Implemented Interfaces:
public final class JimageKt
-
-
Method Summary
Modifier and Type Method Description final static InputStreamgetJrtInputStream(String fileName, File jreHome)Get an input stream to a class file in the JRE. final static PathfindClassWithModuleNameInJrt(String moduleNameAndClassName, File jreHome)Find a class with a prepended module name in the JRT (Java 9+) final static PathfindClassInJrt(String className, File jreHome)Find a class in the JRT (Java 9+) final static UnitforEachClassInJrt(File jreHome, Function1<Path, Unit> block)Iterate over all classes in the JRT (Java 9+) final static UnitforEachClassNameInJrt(File jreHome, Function2<String, String, Unit> block)Iterate over all class names in the JRT (Java 9+) -
-
Method Detail
-
getJrtInputStream
final static InputStream getJrtInputStream(String fileName, File jreHome)
Get an input stream to a class file in the JRE.
- Parameters:
fileName- the file name to the class file in the JRT, including the modulejreHome- the home directory of the JRE
-
findClassWithModuleNameInJrt
final static Path findClassWithModuleNameInJrt(String moduleNameAndClassName, File jreHome)
Find a class with a prepended module name in the JRT (Java 9+)
- Parameters:
moduleNameAndClassName- the module name and the class name, separated by a slashjreHome- the home directory of the JRE
-
findClassInJrt
final static Path findClassInJrt(String className, File jreHome)
Find a class in the JRT (Java 9+)
- Parameters:
className- the class namejreHome- the home directory of the JRE
-
forEachClassInJrt
final static Unit forEachClassInJrt(File jreHome, Function1<Path, Unit> block)
Iterate over all classes in the JRT (Java 9+)
- Parameters:
jreHome- the home directory of the JREblock- the code that should be executed for each class
-
-
-
-