Skip to content

Package io.github.qishr.cascara.common.util

Class JreUtils

java.lang.Object
        io.github.qishr.cascara.common.util.JreUtils


public class JreUtils

Constructor Summary

Constructor Description
JreUtils()

Method Summary

Modifier and Type Method Description
public static String getResourceAsString(Class<?> clazz, String path)
public static InputStream getResourceAsStream(Class<?> clazz, String path) Returns an InputStream for a JRE resource.
public static String getPackageNameFromResourcePath(String path)
public static boolean isJpmsEnabled()
public static Module getUnnamedModule()
public static Module getModule(String moduleName)
public static ProcessHandle parentProcess()
public static java.lang.@io.github.qishr.cascara.common.annotation.Experimental ClassLoader getEffectiveClassLoader()
public static @io.github.qishr.cascara.common.annotation.Experimental boolean isRunningInTerminal()
public static @io.github.qishr.cascara.common.annotation.Experimental boolean isRunningViaGradle()
public static @io.github.qishr.cascara.common.annotation.Experimental boolean isRunningViaEclipse()

Method Details

getResourceAsString

public static String getResourceAsString(Class<?> clazz, String path)

Throws:

LocalizableIOException


getResourceAsStream

@io.github.qishr.cascara.common.annotation.Nullable
public static InputStream getResourceAsStream(Class<?> clazz, String path)

Returns an InputStream for a JRE resource.

Returns:

The InputStream returned by Class.getResourceAsStream.

Throws:

LocalizableIOException


getPackageNameFromResourcePath

public static String getPackageNameFromResourcePath(String path)


isJpmsEnabled

public static boolean isJpmsEnabled()


getUnnamedModule

public static Module getUnnamedModule()


getModule

@io.github.qishr.cascara.common.annotation.Nullable
public static Module getModule(String moduleName)


parentProcess

public static ProcessHandle parentProcess()


getEffectiveClassLoader

@io.github.qishr.cascara.common.annotation.Experimental
public static java.lang.@io.github.qishr.cascara.common.annotation.Experimental ClassLoader getEffectiveClassLoader()


isRunningInTerminal

@io.github.qishr.cascara.common.annotation.Experimental
public static @io.github.qishr.cascara.common.annotation.Experimental boolean isRunningInTerminal()


isRunningViaGradle

@io.github.qishr.cascara.common.annotation.Experimental
public static @io.github.qishr.cascara.common.annotation.Experimental boolean isRunningViaGradle()


isRunningViaEclipse

@io.github.qishr.cascara.common.annotation.Experimental
public static @io.github.qishr.cascara.common.annotation.Experimental boolean isRunningViaEclipse()