Class ClassloaderReader

java.lang.Object
org.eclnt.util.file.ClassloaderReader

public class ClassloaderReader extends Object
Helper class for accessing information via the class loader.

Please note: the resource path that is passed into the methods for loading data (e.g. readFiles(String, boolean) is a string following the format "xxx/yyy/fileName.zzz".
  • Constructor Details

    • ClassloaderReader

      public ClassloaderReader()
      The classloader that is used is the one that also loaded the ClassloaderReader itself.
    • ClassloaderReader

      public ClassloaderReader(boolean useHotDeploymentClassLoader)
      Parameters:
      useHotDeploymentClassLoader - If set to "true" then the class loader is taken from the hot deployment management. Otherwise the class loader is used that also loaded the ClassloaderReader itself.
    • ClassloaderReader

      public ClassloaderReader(ClassLoader classLoader)
      Explicit passing of the class loader.
  • Method Details

    • initializeInfoProvider

      public static void initializeInfoProvider(ClassloaderReader.IInfoProvider infoProvider)
    • readImage

      public ImageIcon readImage(String fileName, boolean error)
    • readFile

      public byte[] readFile(String fileName, boolean error)
    • readResourcePaths

      public List<URL> readResourcePaths(String fileName, boolean error)
    • readUTF8Files

      public List<String> readUTF8Files(String fileName, boolean error)
      Reads all occurrences of a file in the classloader. There may be multiple occurences if the file is contained in more than one .jar library.
    • readFiles

      public List<byte[]> readFiles(String fileName, boolean error)
    • readURLContentAsUTF8

      public String readURLContentAsUTF8(URL url, boolean withError)
    • readURLContent

      public byte[] readURLContent(URL url, boolean withError)
    • readUTF8File

      public String readUTF8File(String fileName, boolean withError)
    • readFileIntoInputStream

      public InputStream readFileIntoInputStream(String fileName, boolean error)
    • getFilesInPathDirectory

      public Set<String> getFilesInPathDirectory(String path)
    • getDirectories

      public Set<String> getDirectories(String path)
    • rightSizeResourceName

      public String rightSizeResourceName(String fileName)
    • checkIfFileExists

      public boolean checkIfFileExists(String fileName)
    • resetBuffers

      public static void resetBuffers()