|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opensaml.util.resource.AbstractFilteredResource
org.opensaml.util.resource.HttpResource
org.opensaml.util.resource.FileBackedHttpResource
public class FileBackedHttpResource
A resource representing a file read from an HTTP(S) location. Every time the file is successfully read from the URL location it is written to a backing file. If the file can not be read from the URL it is read from this backing file, if available. Note, large files should not be accessed in this manner as the entire file is read into memory before being written to disk and then returned.
Constructor Summary | |
---|---|
FileBackedHttpResource(String resource,
String backingFile)
Constructor. |
|
FileBackedHttpResource(String resource,
String backingFile,
ResourceFilter resourceFilter)
Deprecated. use AbstractFilteredResource.setResourceFilter(ResourceFilter) instead |
|
FileBackedHttpResource(String resource,
URI backingFile)
Constructor. |
|
FileBackedHttpResource(String resource,
URI backingFile,
ResourceFilter resourceFilter)
Deprecated. use AbstractFilteredResource.setResourceFilter(ResourceFilter) instead |
Method Summary | |
---|---|
boolean |
exists()
Checks whether the resource exists. |
InputStream |
getInputStream()
Gets the inputstream to the resource's data. |
org.joda.time.DateTime |
getLastModifiedTime()
Gets the date and time the resource was last modified. |
String |
getLocation()
Gets resource location information. |
protected void |
saveToResourceFile(byte[] resource)
Saves a resource to the backing file. |
Methods inherited from class org.opensaml.util.resource.HttpResource |
---|
equals, getResource, hashCode, toString |
Methods inherited from class org.opensaml.util.resource.AbstractFilteredResource |
---|
applyFilter, getResourceFilter, setResourceFilter |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FileBackedHttpResource(String resource, String backingFile)
resource
- HTTP(S) URL of the resourcebackingFile
- filesystem location to store the resourcepublic FileBackedHttpResource(String resource, URI backingFile)
resource
- HTTP(S) URL of the resourcebackingFile
- file: URI location to store the resourcepublic FileBackedHttpResource(String resource, String backingFile, ResourceFilter resourceFilter)
AbstractFilteredResource.setResourceFilter(ResourceFilter)
instead
resource
- HTTP(S) URL of the resourcebackingFile
- filesystem location to store the resourceresourceFilter
- filter to apply to this resourcepublic FileBackedHttpResource(String resource, URI backingFile, ResourceFilter resourceFilter)
AbstractFilteredResource.setResourceFilter(ResourceFilter)
instead
resource
- HTTP(S) URL of the resourcebackingFile
- filesystem location to store the resourceresourceFilter
- filter to apply to this resourceMethod Detail |
---|
public boolean exists() throws ResourceException
exists
in interface Resource
exists
in class HttpResource
ResourceException
- thrown if there is a problem determining if the resource existspublic InputStream getInputStream() throws ResourceException
getInputStream
in interface Resource
getInputStream
in class HttpResource
ResourceException
- thrown if an input stream can not be created for the resourcepublic org.joda.time.DateTime getLastModifiedTime() throws ResourceException
getLastModifiedTime
in interface Resource
getLastModifiedTime
in class HttpResource
ResourceException
- thrown if the last modified time can not be determinedpublic String getLocation()
getLocation
in interface Resource
getLocation
in class HttpResource
protected void saveToResourceFile(byte[] resource) throws ResourceException
resource
- the string representation of the resource
ResourceException
- thrown if the resource backing file can not be written to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |