public class FileBackedHttpResource extends HttpResource
Constructor and Description |
---|
FileBackedHttpResource(String resource,
String backingFile)
Constructor.
|
FileBackedHttpResource(String resource,
String backingFile,
ResourceFilter resourceFilter)
Deprecated.
|
FileBackedHttpResource(String resource,
URI backingFile)
Constructor.
|
FileBackedHttpResource(String resource,
URI backingFile,
ResourceFilter resourceFilter)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
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.
|
equals, getResource, hashCode, toString
applyFilter, getResourceFilter, setResourceFilter
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)
insteadresource
- 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)
insteadresource
- HTTP(S) URL of the resourcebackingFile
- filesystem location to store the resourceresourceFilter
- filter to apply to this resourcepublic 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 resourceResourceException
- thrown if the resource backing file can not be written toCopyright © 2018 JBoss by Red Hat. All rights reserved.