public interface BackupRepository extends NamedListInitializedPlugin, Closeable
Modifier and Type | Interface and Description |
---|---|
static class |
BackupRepository.PathType
This enumeration defines the type of a given path.
|
Modifier and Type | Method and Description |
---|---|
void |
copyFileFrom(Directory sourceDir,
String fileName,
URI dest)
Copy a file from specified
sourceDir to the destination repository (i.e. |
void |
copyFileTo(URI sourceRepo,
String fileName,
Directory dest)
Copy a file from specified
sourceRepo to the destination directory (i.e. |
void |
createDirectory(URI path)
This method creates a directory at the specified path.
|
OutputStream |
createOutput(URI path)
This method returns a OutputStream instance for the specified
path |
URI |
createURI(String path)
This method returns the URI representation for the specified path.
|
void |
deleteDirectory(URI path)
This method deletes a directory at the specified path.
|
boolean |
exists(URI path)
This method checks if the specified path exists in this repository.
|
default String |
getBackupLocation(String override)
This method returns the location where the backup should be stored (or restored from).
|
<T> T |
getConfigProperty(String name)
This method returns the value of the specified configuration property.
|
BackupRepository.PathType |
getPathType(URI path)
This method returns the type of a specified path
|
String[] |
listAll(URI path)
This method returns all the entries (files and directories) in the specified directory.
|
IndexInput |
openInput(URI dirPath,
String fileName,
IOContext ctx)
This method returns a Lucene input stream reading an existing file.
|
URI |
resolve(URI baseUri,
String... pathComponents)
This method resolves a URI using the specified path components (as method arguments).
|
init
default String getBackupLocation(String override)
override
- The location parameter supplied by the user.override
is not null then return the same value
Otherwise return the default configuration value for the CoreAdminParams.BACKUP_LOCATION parameter.<T> T getConfigProperty(String name)
URI createURI(String path)
path
- The path specified by the user.URI resolve(URI baseUri, String... pathComponents)
baseUri
- The base URI to use for creating the pathpathComponents
- The directory (or file-name) to be included in the URI.boolean exists(URI path) throws IOException
path
- The path whose existence needs to be checked.IOException
- in case of errorsBackupRepository.PathType getPathType(URI path) throws IOException
path
- The path whose type needs to be checked.IOException
- in case of errorsString[] listAll(URI path) throws IOException
path
- The directory pathIOException
- in case of errorsIndexInput openInput(URI dirPath, String fileName, IOContext ctx) throws IOException
dirPath
- The parent directory of the file to be readfileName
- The name of the file to be readctx
- the Lucene IO contextIOException
- in case of errorsOutputStream createOutput(URI path) throws IOException
path
path
- The path for which OutputStream needs to be createdpath
IOException
- in case of errorsvoid createDirectory(URI path) throws IOException
path
- The path where the directory needs to be created.IOException
- in case of errorsvoid deleteDirectory(URI path) throws IOException
path
- The path referring to the directory to be deleted.IOException
- in case of errorsvoid copyFileFrom(Directory sourceDir, String fileName, URI dest) throws IOException
sourceDir
to the destination repository (i.e. backup).sourceDir
- The source directory hosting the file to be copied.fileName
- The name of the file to by copieddest
- The destination backup location.IOException
- in case of errorsvoid copyFileTo(URI sourceRepo, String fileName, Directory dest) throws IOException
sourceRepo
to the destination directory (i.e. restore).sourceRepo
- The source URI hosting the file to be copied.fileName
- The name of the file to by copieddest
- The destination where the file should be copied.IOException
- in case of errors.Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.