Class ConfigDataResourceNotFoundException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.boot.context.config.ConfigDataException
org.springframework.boot.context.config.ConfigDataNotFoundException
org.springframework.boot.context.config.ConfigDataResourceNotFoundException
- All Implemented Interfaces:
Serializable
,OriginProvider
ConfigDataNotFoundException
thrown when a ConfigDataResource
cannot be
found.- Since:
- 2.4.0
- Author:
- Phillip Webb
- See Also:
-
Constructor Summary
ConstructorDescriptionCreate a newConfigDataResourceNotFoundException
instance.ConfigDataResourceNotFoundException
(ConfigDataResource resource, Throwable cause) Create a newConfigDataResourceNotFoundException
instance. -
Method Summary
Modifier and TypeMethodDescriptionReturn the original location that was resolved to determine the resource.Return the source origin ornull
if the origin is not known.Return a description of actual referenced item that could not be found.Return the resource that could not be found.static void
throwIfDoesNotExist
(ConfigDataResource resource, File fileToCheck) Throw aConfigDataNotFoundException
if the specifiedFile
does not exist.static void
throwIfDoesNotExist
(ConfigDataResource resource, Path pathToCheck) Throw aConfigDataNotFoundException
if the specifiedPath
does not exist.static void
throwIfDoesNotExist
(ConfigDataResource resource, Resource resourceToCheck) Throw aConfigDataNotFoundException
if the specifiedResource
does not exist.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ConfigDataResourceNotFoundException
Create a newConfigDataResourceNotFoundException
instance.- Parameters:
resource
- the resource that could not be found
-
ConfigDataResourceNotFoundException
Create a newConfigDataResourceNotFoundException
instance.- Parameters:
resource
- the resource that could not be foundcause
- the exception cause
-
-
Method Details
-
getResource
Return the resource that could not be found.- Returns:
- the resource
-
getLocation
Return the original location that was resolved to determine the resource.- Returns:
- the location or
null
if no location is available
-
getOrigin
Description copied from interface:OriginProvider
Return the source origin ornull
if the origin is not known.- Returns:
- the origin or
null
-
getReferenceDescription
Description copied from class:ConfigDataNotFoundException
Return a description of actual referenced item that could not be found.- Specified by:
getReferenceDescription
in classConfigDataNotFoundException
- Returns:
- a description of the referenced items
-
throwIfDoesNotExist
Throw aConfigDataNotFoundException
if the specifiedPath
does not exist.- Parameters:
resource
- the config data resourcepathToCheck
- the path to check
-
throwIfDoesNotExist
Throw aConfigDataNotFoundException
if the specifiedFile
does not exist.- Parameters:
resource
- the config data resourcefileToCheck
- the file to check
-
throwIfDoesNotExist
Throw aConfigDataNotFoundException
if the specifiedResource
does not exist.- Parameters:
resource
- the config data resourceresourceToCheck
- the resource to check
-