Package org.cryptacular.io
Class URLResource
java.lang.Object
org.cryptacular.io.URLResource
- All Implemented Interfaces:
Resource
Describes a (presumably remote) resource accessible via URL.
- Author:
- Middleware Services
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
URLResource
Creates a new URL resource.- Parameters:
url
- Non-null URL where resource is located.
-
-
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
-