public class FileBackedHTTPResource extends HTTPResource
| Modifier and Type | Field and Description |
|---|---|
private Resource |
backingResource
Backing resource file.
|
private Logger |
log
Logger.
|
| Constructor and Description |
|---|
FileBackedHTTPResource(HttpClient client,
String url,
Resource resource)
Constructor.
|
FileBackedHTTPResource(HttpClient client,
URL url,
Resource resource)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
long |
contentLength() |
HTTPResource |
createRelative(String relativePath)
Based on
UrlResource. |
boolean |
exists() |
String |
getDescription() |
InputStream |
getInputStream() |
long |
lastModified() |
protected InputStream |
saveAndClone(InputStream input)
saveAndClone.
|
afterPropertiesSet, buildHttpClientContext, createRelativeResource, getFile, getFilename, getResourceHeaders, getResponseHeader, getURI, getURL, isOpen, isReadable, reportCachingStatus, setBeanNamedoInitialize, getId, setIdprivate final Logger log
private final Resource backingResource
public FileBackedHTTPResource(@Nonnull HttpClient client, @NotEmpty@Nonnull String url, @Nonnull Resource resource) throws IOException
client - the client we use to connect with.url - URL to the remote dataresource - the file to use as backing storeIOException - if the URL was badly formedpublic FileBackedHTTPResource(@Nonnull HttpClient client, @Nonnull URL url, @Nonnull Resource resource) throws IOException
client - the client we use to connect with.url - URL to the remote dataresource - the file to use as backing storeIOException - if the URL was badly formedprotected InputStream saveAndClone(InputStream input) throws IOException
input - the input streamIOException - if an error happens. If the backing file might have been corrupted we delete it.public InputStream getInputStream() throws IOException
getInputStream in interface net.shibboleth.utilities.java.support.resource.ResourcegetInputStream in interface InputStreamSourcegetInputStream in class HTTPResourceIOExceptionpublic boolean exists()
exists in interface net.shibboleth.utilities.java.support.resource.Resourceexists in class HTTPResourcepublic long contentLength()
throws IOException
contentLength in interface net.shibboleth.utilities.java.support.resource.ResourcecontentLength in class HTTPResourceIOExceptionpublic long lastModified()
throws IOException
lastModified in interface net.shibboleth.utilities.java.support.resource.ResourcelastModified in class HTTPResourceIOExceptionpublic HTTPResource createRelative(String relativePath) throws IOException
UrlResource.createRelative in class HTTPResourceIOExceptionpublic String getDescription()
getDescription in interface net.shibboleth.utilities.java.support.resource.ResourcegetDescription in class HTTPResourceCopyright © 1999–2015. All rights reserved.