public class PathResource extends AbstractResource
| Constructor and Description |
|---|
PathResource(String logicalPath,
Path path) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
exists() |
boolean |
isWritable()
Return true if the resource can be written to
|
InputStream |
openInputStream()
Opens an input stream to read from this resource.
|
OutputStream |
openOutputStream(boolean createIfNeeded)
Opens an output stream to write to this resource.
|
Resource |
resolve(String other)
Resolve the given path against this resource.
|
Resource |
resolveSibling(String other)
Resolves the given path against this resource's parent path.
|
equals, getPath, getUri, hashCode, resolvePath, resolveSiblingPath, toStringpublic InputStream openInputStream() throws IOException
ResourceIOException - if there is an error reading from the resource, including if the resource does not exist or cannot be read.public boolean exists()
public Resource resolve(String other)
Resourcepublic Resource resolveSibling(String other)
Resourcepublic boolean isWritable()
ResourceisWritable in interface ResourceisWritable in class AbstractResourcepublic OutputStream openOutputStream(boolean createIfNeeded) throws IOException
ResourceopenOutputStream in interface ResourceopenOutputStream in class AbstractResourcecreateIfNeeded - if true, create the resource if it does not exist. If false, throw an exception if it does not existIOException - if there is an error writing to the resource, including if the resource does not exist or permission don't allow writing.Copyright © 2022 Liquibase.org. All rights reserved.