public class OriginTrackedResource extends java.lang.Object implements org.springframework.core.io.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() |
org.springframework.core.io.Resource |
createRelative(java.lang.String relativePath) |
boolean |
equals(java.lang.Object obj) |
boolean |
exists() |
java.lang.String |
getDescription() |
java.io.File |
getFile() |
java.lang.String |
getFilename() |
java.io.InputStream |
getInputStream() |
Origin |
getOrigin()
Return the source origin or
null if the origin is not known. |
org.springframework.core.io.Resource |
getResource() |
java.net.URI |
getURI() |
java.net.URL |
getURL() |
int |
hashCode() |
boolean |
isFile() |
boolean |
isOpen() |
boolean |
isReadable() |
long |
lastModified() |
static OriginTrackedResource |
of(org.springframework.core.io.Resource resource,
Origin origin)
Return a new
origin tracked version the given
Resource . |
static OriginTrackedResource.OriginTrackedWritableResource |
of(org.springframework.core.io.WritableResource resource,
Origin origin)
Return a new
origin tracked version the given
WritableResource . |
java.nio.channels.ReadableByteChannel |
readableChannel() |
java.lang.String |
toString() |
public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in interface org.springframework.core.io.InputStreamSource
java.io.IOException
public boolean exists()
exists
in interface org.springframework.core.io.Resource
public boolean isReadable()
isReadable
in interface org.springframework.core.io.Resource
public boolean isOpen()
isOpen
in interface org.springframework.core.io.Resource
public boolean isFile()
isFile
in interface org.springframework.core.io.Resource
public java.net.URL getURL() throws java.io.IOException
getURL
in interface org.springframework.core.io.Resource
java.io.IOException
public java.net.URI getURI() throws java.io.IOException
getURI
in interface org.springframework.core.io.Resource
java.io.IOException
public java.io.File getFile() throws java.io.IOException
getFile
in interface org.springframework.core.io.Resource
java.io.IOException
public java.nio.channels.ReadableByteChannel readableChannel() throws java.io.IOException
readableChannel
in interface org.springframework.core.io.Resource
java.io.IOException
public long contentLength() throws java.io.IOException
contentLength
in interface org.springframework.core.io.Resource
java.io.IOException
public long lastModified() throws java.io.IOException
lastModified
in interface org.springframework.core.io.Resource
java.io.IOException
public org.springframework.core.io.Resource createRelative(java.lang.String relativePath) throws java.io.IOException
createRelative
in interface org.springframework.core.io.Resource
java.io.IOException
public java.lang.String getFilename()
getFilename
in interface org.springframework.core.io.Resource
public java.lang.String getDescription()
getDescription
in interface org.springframework.core.io.Resource
public org.springframework.core.io.Resource getResource()
public Origin getOrigin()
OriginProvider
null
if the origin is not known.getOrigin
in interface OriginProvider
null
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static OriginTrackedResource.OriginTrackedWritableResource of(org.springframework.core.io.WritableResource resource, Origin origin)
origin tracked
version the given
WritableResource
.resource
- the tracked resourceorigin
- the origin of the resourceOriginTrackedResource.OriginTrackedWritableResource
instancepublic static OriginTrackedResource of(org.springframework.core.io.Resource resource, Origin origin)
origin tracked
version the given
Resource
.resource
- the tracked resourceorigin
- the origin of the resourceOriginTrackedResource
instance