Package org.springframework.boot.origin
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
Modifier and TypeClassDescriptionstatic class
Variant ofOriginTrackedResource
forWritableResource
instances. -
Method Summary
Modifier and TypeMethodDescriptionlong
createRelative
(String relativePath) boolean
boolean
exists()
getFile()
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()
-
Method Details
-
getInputStream
- Specified by:
getInputStream
in interfaceInputStreamSource
- Throws:
IOException
-
exists
public boolean exists() -
isReadable
public boolean isReadable()- Specified by:
isReadable
in interfaceResource
-
isOpen
public boolean isOpen() -
isFile
public boolean 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
public int 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:
- a
OriginTrackedResource.OriginTrackedWritableResource
instance
-
of
Return a neworigin tracked
version the givenResource
.- Parameters:
resource
- the tracked resourceorigin
- the origin of the resource- Returns:
- a
OriginTrackedResource
instance
-