public class OriginTrackedResource extends Object implements Resource, OriginProvider
of(Resource, Origin)
,
of(WritableResource, Origin)
,
OriginProvider
Modifier and Type | Class and Description |
---|---|
static class |
OriginTrackedResource.OriginTrackedWritableResource
Variant of
OriginTrackedResource for WritableResource instances. |
Modifier and Type | Method and Description |
---|---|
long |
contentLength() |
Resource |
createRelative(String relativePath) |
boolean |
equals(Object obj) |
boolean |
exists() |
String |
getDescription() |
File |
getFile() |
String |
getFilename() |
InputStream |
getInputStream() |
Origin |
getOrigin()
Return the source origin or
null if the origin is not known. |
Resource |
getResource() |
URI |
getURI() |
URL |
getURL() |
int |
hashCode() |
boolean |
isFile() |
boolean |
isOpen() |
boolean |
isReadable() |
long |
lastModified() |
static OriginTrackedResource |
of(Resource resource,
Origin origin)
Return a new
origin tracked version the given
Resource . |
static OriginTrackedResource.OriginTrackedWritableResource |
of(WritableResource resource,
Origin origin)
Return a new
origin tracked version the given
WritableResource . |
ReadableByteChannel |
readableChannel() |
String |
toString() |
public InputStream getInputStream() throws IOException
getInputStream
in interface InputStreamSource
IOException
public boolean isReadable()
isReadable
in interface Resource
public URL getURL() throws IOException
getURL
in interface Resource
IOException
public URI getURI() throws IOException
getURI
in interface Resource
IOException
public File getFile() throws IOException
getFile
in interface Resource
IOException
public ReadableByteChannel readableChannel() throws IOException
readableChannel
in interface Resource
IOException
public long contentLength() throws IOException
contentLength
in interface Resource
IOException
public long lastModified() throws IOException
lastModified
in interface Resource
IOException
public Resource createRelative(String relativePath) throws IOException
createRelative
in interface Resource
IOException
public String getFilename()
getFilename
in interface Resource
public String getDescription()
getDescription
in interface Resource
public Resource getResource()
public Origin getOrigin()
OriginProvider
null
if the origin is not known.getOrigin
in interface OriginProvider
null
public static OriginTrackedResource.OriginTrackedWritableResource of(WritableResource resource, Origin origin)
origin tracked
version the given
WritableResource
.resource
- the tracked resourceorigin
- the origin of the resourceOriginTrackedResource.OriginTrackedWritableResource
instancepublic static OriginTrackedResource of(Resource resource, Origin origin)
origin tracked
version the given
Resource
.resource
- the tracked resourceorigin
- the origin of the resourceOriginTrackedResource
instance