Package org.apache.juneau.cp
Class LocalFile
java.lang.Object
org.apache.juneau.cp.LocalFile
Identifies a file located either on the classpath or file system.
 Used to encapsulate basic resolution and retrieval of files regardless of where they are located.
 
See Also:
- 
Constructor SummaryConstructors
- 
Method Summary
- 
Constructor Details- 
LocalFileConstructor for classpath file.- Parameters:
- clazz- The class used to retrieve resources. Must not be- null .
- clazzPath- The path relative to the class. Must be a non-null normalized relative path.
 
- 
LocalFileConstructor for file system file.- Parameters:
- path- Filesystem file location. Must not be- null .
 
 
- 
- 
Method Details- 
readReturns the contents of this file.- Returns:
- An input stream of the contents of this file.
- Throws:
- IOException- If file could not be read.
 
- 
sizeReturns the size of this file.- Returns:
- The size of this file in bytes, or -1 if not known.
- Throws:
- IOException- If file size could not be determined.
 
- 
cacheCaches the contents of this file into an internal byte array for quick future retrieval.- Returns:
- This object.
- Throws:
- IOException- If file could not be read.
 
- 
getNameReturns the name of this file.- Returns:
- The name of this file.
 
 
-