public class FileSource
extends java.lang.Object
| Constructor and Description |
|---|
FileSource(java.lang.String dnBase,
java.io.File pathBase)
Construct a FileSource with the passed bases.
|
| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
getFile(java.lang.String filename)
Return an open InputStream from which to read the bytes
of the file with the passed filename.
|
java.io.InputStream |
getFile(java.lang.String path,
java.lang.String[] baseURI)
Return an open InputStream from which to read the bytes
of the file with the passed filename.
|
java.lang.String |
resolveFilename(java.lang.String filename)
Resolve a file system filename with the pathBase we have in this object.
|
public FileSource(java.lang.String dnBase,
java.io.File pathBase)
dnBase - Base location for objects in directory.pathBase - Base location for files in file system.public java.io.InputStream getFile(java.lang.String filename)
throws java.io.IOException
filename - The name of the file to get.java.io.IOException - if data cannot be foundpublic java.io.InputStream getFile(java.lang.String path,
java.lang.String[] baseURI)
throws java.io.IOException
path - The name of the file to get.baseURI - An array (of at least one) String in which to
return the URI of the found data. (May be null)java.io.IOException - if data cannot be foundpublic java.lang.String resolveFilename(java.lang.String filename)
throws java.io.FileNotFoundException
filename - Filename to resolve.java.io.FileNotFoundException