Class ResourceUtil
- java.lang.Object
-
- net.sourceforge.pmd.util.fxdesigner.util.ResourceUtil
-
public final class ResourceUtil extends Object
Deals with resource fetching and the hardcore details of when we're in a Jar vs when we're exploded in the IDE.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stream<Class<?>>
getClassesInPackage(String packageName)
Finds the classes in the given package by looking in the classpath directories.static FileSystem
getFileSystem(URI uri)
static String
readToString(InputStream stream, Charset charset)
static String
resolveResource(String relativeToDesignerDir)
Prepends a resource path with the root resource path of the designer.static Path
thisJarPathInHost()
Returns an absolute path to the code location, ie the jar in which the app is bundled, or the directory in which the classes are laid out.
-
-
-
Method Detail
-
resolveResource
public static String resolveResource(String relativeToDesignerDir)
Prepends a resource path with the root resource path of the designer. The given string path should not start with "/".
-
getClassesInPackage
public static Stream<Class<?>> getClassesInPackage(String packageName)
Finds the classes in the given package by looking in the classpath directories.
-
thisJarPathInHost
public static Path thisJarPathInHost()
Returns an absolute path to the code location, ie the jar in which the app is bundled, or the directory in which the classes are laid out.
-
getFileSystem
public static FileSystem getFileSystem(URI uri) throws IOException
- Throws:
IOException
-
readToString
public static String readToString(InputStream stream, Charset charset)
-
-