Package liquibase.resource
Interface PathHandler
-
- All Superinterfaces:
Plugin
- All Known Implementing Classes:
AbstractPathHandler
,DirectoryPathHandler
,ZipPathHandler
public interface PathHandler extends Plugin
Interface for extensions that can translate path strings intoResourceAccessor
s andInputStream
s.
-
-
Field Summary
-
Fields inherited from interface liquibase.plugin.Plugin
PRIORITY_DATABASE, PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OutputStream
createResource(String path)
Creates a new resource at the specified path and returns an OutputStream for writing to it.int
getPriority(String root)
Priority of this parser for the given path.Resource
getResource(String path)
Parse the given "absolute" path and return aResource
for it if it exists.ResourceAccessor
getResourceAccessor(String root)
Parse the given path and return aResourceAccessor
for it.
-
-
-
Method Detail
-
getPriority
int getPriority(String root)
Priority of this parser for the given path. The implementation with the highest priority will be used.
-
getResourceAccessor
ResourceAccessor getResourceAccessor(String root) throws IOException, FileNotFoundException
Parse the given path and return aResourceAccessor
for it.- Throws:
IOException
- if the path is invalidFileNotFoundException
- if the path is valid but does not exist
-
getResource
Resource getResource(String path) throws IOException
Parse the given "absolute" path and return aResource
for it if it exists.- Returns:
- a Resource even if the resource does not exist. Callers can check
Resource.exists()
to determine if it exists or not - Throws:
IOException
- if the path is invalid
-
createResource
OutputStream createResource(String path) throws IOException
Creates a new resource at the specified path and returns an OutputStream for writing to it.- Throws:
FileAlreadyExistsException
- if the file already existsIOException
- if the path cannot be written to
-
-