org.eclnt.util.file

## Class ClassloaderReader

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

-     public class ClassloaderReader
      extends java.lang.Object

  Helper class for accessing information via the class loader.
  Please note: the resource path that is passed into the methods for laoding data (e.g. `readFiles(String, boolean)` is a string following the format "xxx/yyy/fileName.zzz".

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClassloaderReader()` The classloader that is used is the one that also loaded the ClassloaderReader itself.
    `ClassloaderReader(boolean useHotDeploymentClassLoader)`
    `ClassloaderReader(java.lang.ClassLoader classLoader)` Explicit passing of the class loader.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `readFile(java.lang.String fileName, boolean error)`
    `java.util.List<byte[]>` | `readFiles(java.lang.String fileName, boolean error)`
    `javax.swing.ImageIcon` | `readImage(java.lang.String fileName, boolean error)`
    `java.lang.String` | `readUTF8File(java.lang.String fileName, boolean withError)`
    `java.util.List<java.lang.String>` | `readUTF8Files(java.lang.String fileName, boolean error)`
    `java.lang.String` | `rightSizeResourceName(java.lang.String fileName)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### 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(java.lang.ClassLoader classLoader)

      Explicit passing of the class loader.

  - ### Method Detail

    - #### readImage

          public javax.swing.ImageIcon readImage(java.lang.String fileName,
                                                 boolean error)

    - #### readFile

          public byte[] readFile(java.lang.String fileName,
                                 boolean error)

    - #### readUTF8Files

          public java.util.List<java.lang.String> readUTF8Files(java.lang.String fileName,
                                                                boolean error)

    - #### readFiles

          public java.util.List<byte[]> readFiles(java.lang.String fileName,
                                                  boolean error)

    - #### readUTF8File

          public java.lang.String readUTF8File(java.lang.String fileName,
                                               boolean withError)

    - #### rightSizeResourceName

          public java.lang.String rightSizeResourceName(java.lang.String fileName)

Copyright © CaptainCasa Gmbh. All Rights Reserved.