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
Nested ClassesModifier and TypeClassDescriptionstatic classVariant ofOriginTrackedResourceforWritableResourceinstances. -
Method Summary
Modifier and TypeMethodDescriptionlongorg.springframework.core.io.ResourcecreateRelative(String relativePath) booleanbooleanexists()getFile()Return the source origin ornullif the origin is not known.org.springframework.core.io.ResourcegetURI()getURL()inthashCode()booleanisFile()booleanisOpen()booleanlongstatic OriginTrackedResourceReturn a neworigin trackedversion the givenResource.Return a neworigin trackedversion the givenWritableResource.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.core.io.Resource
getContentAsByteArray, getContentAsString
-
Method Details
-
getInputStream
- Specified by:
getInputStreamin interfaceorg.springframework.core.io.InputStreamSource- Throws:
IOException
-
exists
public boolean exists()- Specified by:
existsin interfaceorg.springframework.core.io.Resource
-
isReadable
public boolean isReadable()- Specified by:
isReadablein interfaceorg.springframework.core.io.Resource
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceorg.springframework.core.io.Resource
-
isFile
public boolean isFile()- Specified by:
isFilein interfaceorg.springframework.core.io.Resource
-
getURL
- Specified by:
getURLin interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
getURI
- Specified by:
getURIin interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
getFile
- Specified by:
getFilein interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
readableChannel
- Specified by:
readableChannelin interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
contentLength
- Specified by:
contentLengthin interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
lastModified
- Specified by:
lastModifiedin interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
createRelative
- Specified by:
createRelativein interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
getFilename
- Specified by:
getFilenamein interfaceorg.springframework.core.io.Resource
-
getDescription
- Specified by:
getDescriptionin interfaceorg.springframework.core.io.Resource
-
getResource
public org.springframework.core.io.Resource getResource() -
getOrigin
Description copied from interface:OriginProviderReturn the source origin ornullif the origin is not known.- Specified by:
getOriginin 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 trackedversion the givenWritableResource.- Parameters:
resource- the tracked resourceorigin- the origin of the resource- Returns:
- an
OriginTrackedResource.OriginTrackedWritableResourceinstance
-
of
public static OriginTrackedResource of(org.springframework.core.io.Resource resource, Origin origin) Return a neworigin trackedversion the givenResource.- Parameters:
resource- the tracked resourceorigin- the origin of the resource- Returns:
- an
OriginTrackedResourceinstance
-