Class OriginTrackedResource
java.lang.Object
org.springframework.boot.origin.OriginTrackedResource
- All Implemented Interfaces:
OriginProvider
,InputStreamSource
,Resource
- Direct Known Subclasses:
OriginTrackedResource.OriginTrackedWritableResource
- Since:
- 2.4.0
- Author:
- Phillip Webb
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Variant ofOriginTrackedResource
forWritableResource
instances. -
Method Summary
Modifier and TypeMethodDescriptionlong
createRelative
(String relativePath) boolean
boolean
exists()
getFile()
@Nullable String
@Nullable Origin
Return the source origin ornull
if the origin is not known.getURI()
getURL()
int
hashCode()
boolean
isFile()
boolean
isOpen()
boolean
long
static OriginTrackedResource
Return a neworigin tracked
version the givenResource
.of
(WritableResource resource, Origin origin) 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, getFilePath
-
Method Details
-
getInputStream
- Specified by:
getInputStream
in interfaceInputStreamSource
- Throws:
IOException
-
exists
-
isReadable
public boolean isReadable()- Specified by:
isReadable
in interfaceResource
-
isOpen
-
isFile
-
getURL
- Specified by:
getURL
in interfaceResource
- Throws:
IOException
-
getURI
- Specified by:
getURI
in interfaceResource
- Throws:
IOException
-
getFile
- Specified by:
getFile
in interfaceResource
- Throws:
IOException
-
readableChannel
- Specified by:
readableChannel
in interfaceResource
- Throws:
IOException
-
contentLength
- Specified by:
contentLength
in interfaceResource
- Throws:
IOException
-
lastModified
- Specified by:
lastModified
in interfaceResource
- Throws:
IOException
-
createRelative
- Specified by:
createRelative
in interfaceResource
- Throws:
IOException
-
getFilename
- Specified by:
getFilename
in interfaceResource
-
getDescription
- Specified by:
getDescription
in interfaceResource
-
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
-
toString
-
of
public static OriginTrackedResource.OriginTrackedWritableResource of(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
Return a neworigin tracked
version the givenResource
.- Parameters:
resource
- the tracked resourceorigin
- the origin of the resource- Returns:
- an
OriginTrackedResource
instance
-