Package liquibase.resource
Class AbstractResource
java.lang.Object
liquibase.resource.AbstractResource
- All Implemented Interfaces:
Resource
- Direct Known Subclasses:
MockResource
,PathResource
,ResourceAccessor.NotFoundResource
,URIResource
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
getPath()
Returns the normalized, ResourceAccessor-relative path for this resource.getUri()
Returns a unique and complete identifier for this resource.int
hashCode()
boolean
Return true if the resource can be written toopenOutputStream
(OpenOptions openOptions) Opens an output stream given the passedOpenOptions
.protected String
resolvePath
(String other) Convenience method for computing the relative path inResource.resolve(String)
implementationsprotected String
resolveSiblingPath
(String other) Convenience method for computing the relative path inResource.resolveSibling(String)
implementations.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface liquibase.resource.Resource
exists, openInputStream, openOutputStream, resolve, resolveSibling
-
Constructor Details
-
AbstractResource
-
-
Method Details
-
getPath
Description copied from interface:Resource
Returns the normalized, ResourceAccessor-relative path for this resource. To get the unique location of this resource, useResource.getUri()
This should always use `/` for separators This should not include any sort of protocol or prefixes This should not have a leading /. This should have any relative paths smoothed out -- return "path/to/resource" not "path/from/../to/resource". -
getUri
Description copied from interface:Resource
Returns a unique and complete identifier for this resource. This will be different than what is returned byResource.getPath()
because the path within the resource accessor whereas this is the a complete path to it.For example, a file resource may return a path of
my/file.txt
and a uri offile:/tmp/project/liquibase/my/file.txt
for a resource accessor usingfile:/tmp/project/liquibase
as a root -
isWritable
public boolean isWritable()Description copied from interface:Resource
Return true if the resource can be written to- Specified by:
isWritable
in interfaceResource
-
openOutputStream
Description copied from interface:Resource
Opens an output stream given the passedOpenOptions
. Cannot pass a null OpenOptions value- Specified by:
openOutputStream
in interfaceResource
- Throws:
IOException
-
toString
-
hashCode
public int hashCode() -
equals
-
resolvePath
Convenience method for computing the relative path inResource.resolve(String)
implementations -
resolveSiblingPath
Convenience method for computing the relative path inResource.resolveSibling(String)
implementations.
-