Class ResourceUtil


  • public final class ResourceUtil
    extends java.lang.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 java.util.stream.Stream<java.lang.Class<?>> getClassesInPackage​(java.lang.String packageName)
      Finds the classes in the given package by looking in the classpath directories.
      static java.nio.file.FileSystem getFileSystem​(java.net.URI uri)  
      static java.lang.String resolveResource​(java.lang.String relativeToDesignerDir)
      Prepends a resource path with the root resource path of the designer.
      static java.nio.file.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • resolveResource

        public static java.lang.String resolveResource​(java.lang.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 java.util.stream.Stream<java.lang.Class<?>> getClassesInPackage​(java.lang.String packageName)
        Finds the classes in the given package by looking in the classpath directories.
      • thisJarPathInHost

        public static java.nio.file.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 java.nio.file.FileSystem getFileSystem​(java.net.URI uri)
                                                      throws java.io.IOException
        Throws:
        java.io.IOException