Package org.cryptacular.io
Class FileResource
java.lang.Object
org.cryptacular.io.FileResource
- All Implemented Interfaces:
Resource
Resource that produces a buffered
FileInputStream
from a file.- Author:
- Middleware Services
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
FileResource
Creates a new file resource.- Parameters:
file
- Non-null file.
-
-
Method Details
-
getInputStream
Description copied from interface:Resource
Gets an input stream around the resource. Callers of this method are responsible for resource cleanup; it should be sufficient to simply callInputStream.close()
unless otherwise noted.Implementers should produce a new instance on every call to this method to provide for thread-safe usage patterns on a shared resource.
- Specified by:
getInputStream
in interfaceResource
- Returns:
- Input stream around underlying resource, e.g. file, remote resource (URI), etc.
- Throws:
IOException
- On IO errors.
-
toString
-