Package org.eclnt.util.file
Class ClassloaderReader
java.lang.Object
org.eclnt.util.file.ClassloaderReader
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.
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".-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionThe classloader that is used is the one that also loaded the ClassloaderReader itself.ClassloaderReader
(boolean useHotDeploymentClassLoader) ClassloaderReader
(ClassLoader classLoader) Explicit passing of the class loader. -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkIfFileExists
(String fileName) getDirectories
(String path) static void
initializeInfoProvider
(ClassloaderReader.IInfoProvider infoProvider) byte[]
readFileIntoInputStream
(String fileName, boolean error) List<byte[]>
readResourcePaths
(String fileName, boolean error) byte[]
readURLContent
(URL url, boolean withError) readURLContentAsUTF8
(URL url, boolean withError) readUTF8File
(String fileName, boolean withError) readUTF8Files
(String fileName, boolean error) Reads all occurrences of a file in the classloader.static void
rightSizeResourceName
(String fileName)
-
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
Explicit passing of the class loader.
-
-
Method Details
-
initializeInfoProvider
-
readImage
-
readFile
-
readResourcePaths
-
readUTF8Files
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
-
readURLContentAsUTF8
-
readURLContent
-
readUTF8File
-
readFileIntoInputStream
-
getFilesInPathDirectory
-
getDirectories
-
rightSizeResourceName
-
checkIfFileExists
-
resetBuffers
public static void resetBuffers()
-