Package org.springframework.boot.origin
Class OriginTrackedResource
java.lang.Object
org.springframework.boot.origin.OriginTrackedResource
- All Implemented Interfaces:
OriginProvider
,org.springframework.core.io.InputStreamSource
,org.springframework.core.io.Resource
- Direct Known Subclasses:
OriginTrackedResource.OriginTrackedWritableResource
public class OriginTrackedResource
extends Object
implements org.springframework.core.io.Resource, OriginProvider
- Since:
- 2.4.0
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Variant ofOriginTrackedResource
forWritableResource
instances. -
Method Summary
Modifier and TypeMethodDescriptionlong
org.springframework.core.io.Resource
createRelative
(String relativePath) boolean
boolean
exists()
getFile()
Return the source origin ornull
if the origin is not known.org.springframework.core.io.Resource
getURI()
getURL()
int
hashCode()
boolean
isFile()
boolean
isOpen()
boolean
long
static OriginTrackedResource
Return a neworigin tracked
version the givenResource
.Return a neworigin tracked
version the givenWritableResource
.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.io.Resource
getContentAsByteArray, getContentAsString
-
Method Details
-
getInputStream
- Specified by:
getInputStream
in interfaceorg.springframework.core.io.InputStreamSource
- Throws:
IOException
-
exists
public boolean exists()- Specified by:
exists
in interfaceorg.springframework.core.io.Resource
-
isReadable
public boolean isReadable()- Specified by:
isReadable
in interfaceorg.springframework.core.io.Resource
-
isOpen
public boolean isOpen()- Specified by:
isOpen
in interfaceorg.springframework.core.io.Resource
-
isFile
public boolean isFile()- Specified by:
isFile
in interfaceorg.springframework.core.io.Resource
-
getURL
- Specified by:
getURL
in interfaceorg.springframework.core.io.Resource
- Throws:
IOException
-
getURI
- Specified by:
getURI
in interfaceorg.springframework.core.io.Resource
- Throws:
IOException
-
getFile
- Specified by:
getFile
in interfaceorg.springframework.core.io.Resource
- Throws:
IOException
-
readableChannel
- Specified by:
readableChannel
in interfaceorg.springframework.core.io.Resource
- Throws:
IOException
-
contentLength
- Specified by:
contentLength
in interfaceorg.springframework.core.io.Resource
- Throws:
IOException
-
lastModified
- Specified by:
lastModified
in interfaceorg.springframework.core.io.Resource
- Throws:
IOException
-
createRelative
- Specified by:
createRelative
in interfaceorg.springframework.core.io.Resource
- Throws:
IOException
-
getFilename
- Specified by:
getFilename
in interfaceorg.springframework.core.io.Resource
-
getDescription
- Specified by:
getDescription
in interfaceorg.springframework.core.io.Resource
-
getResource
public org.springframework.core.io.Resource getResource() -
getOrigin
Description copied from interface:OriginProvider
Return the source origin ornull
if the origin is not known.- Specified by:
getOrigin
in interfaceOriginProvider
- Returns:
- the origin or
null
-
equals
-
hashCode
public int hashCode() -
toString
-
of
public static OriginTrackedResource.OriginTrackedWritableResource of(org.springframework.core.io.WritableResource resource, Origin origin) Return a neworigin tracked
version the givenWritableResource
.- Parameters:
resource
- the tracked resourceorigin
- the origin of the resource- Returns:
- an
OriginTrackedResource.OriginTrackedWritableResource
instance
-
of
public static OriginTrackedResource of(org.springframework.core.io.Resource resource, Origin origin) Return a neworigin tracked
version the givenResource
.- Parameters:
resource
- the tracked resourceorigin
- the origin of the resource- Returns:
- an
OriginTrackedResource
instance
-