Package net.sf.basedb.util.bfs
Class BaseInputStreamLocator
java.lang.Object
net.sf.basedb.util.bfs.BaseInputStreamLocator
- All Implemented Interfaces:
InputStreamLocator
Input stream locator implementation that works with files within a given
directory in the BASE file system. The files must be located in the
specified root directory. Subdirectories or parent paths are not
supported.
- Version:
- 2.15
- Author:
- Nicklas
- Last modified
- $Date: 2010-01-29 14:34:03 +0100 (fr, 29 jan 2010) $
-
Field Summary
-
Constructor Summary
ConstructorDescriptionBaseInputStreamLocator
(DbControl dc, Directory dir) Create a new input stream locator. -
Method Summary
Modifier and TypeMethodDescriptionprivate File
getInputStream
(String filename) Finds and opens an input stream to the file with the given filename.long
Get the size in bytes of the given named resource.
-
Field Details
-
dc
-
dir
-
cache
-
-
Constructor Details
-
BaseInputStreamLocator
Create a new input stream locator.- Parameters:
dc
- A DbControl to use for database accessdir
- The directory in the BASE file system in which the files should be located
-
-
Method Details
-
getInputStream
Finds and opens an input stream to the file with the given filename.- Specified by:
getInputStream
in interfaceInputStreamLocator
- Parameters:
filename
- The name (for example a file name) of the resource- Returns:
- An input stream
- Throws:
IOException
- If there is any problem with locating or opening the resource
-
getSize
Description copied from interface:InputStreamLocator
Get the size in bytes of the given named resource.- Specified by:
getSize
in interfaceInputStreamLocator
- Parameters:
filename
- The name (for example a file name) of the resouce- Returns:
- The size in bytes, or -1 if not known
-
getFile
-