Package liquibase.resource
Class DirectoryPathHandler
- java.lang.Object
-
- liquibase.resource.AbstractPathHandler
-
- liquibase.resource.DirectoryPathHandler
-
- All Implemented Interfaces:
Plugin
,PathHandler
public class DirectoryPathHandler extends AbstractPathHandler
PathHandler
that converts the path into aDirectoryResourceAccessor
.
-
-
Field Summary
-
Fields inherited from interface liquibase.plugin.Plugin
PRIORITY_DATABASE, PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED
-
-
Constructor Summary
Constructors Constructor Description DirectoryPathHandler()
-
Method Summary
All Methods Instance Methods Concrete 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)
ReturnsPlugin.PRIORITY_DEFAULT
for all paths except for ones that are for a non-"file:" protocol.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
public int getPriority(String root)
ReturnsPlugin.PRIORITY_DEFAULT
for all paths except for ones that are for a non-"file:" protocol.
-
getResourceAccessor
public ResourceAccessor getResourceAccessor(String root) throws FileNotFoundException
Description copied from interface:PathHandler
Parse the given path and return aResourceAccessor
for it.- Throws:
FileNotFoundException
- if the path is valid but does not exist
-
getResource
public Resource getResource(String path) throws IOException
Description copied from interface:PathHandler
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
public OutputStream createResource(String path) throws IOException
Description copied from interface:PathHandler
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
-
-