public class LocalFileSystemRepository extends Object implements BackupRepository
BackupRepository.PathType| Constructor and Description |
|---|
LocalFileSystemRepository() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
copyIndexFileFrom(Directory sourceDir,
String sourceFileName,
URI destDir,
String destFileName)
Copy an index file from specified
sourceDir to the destination repository (i.e. |
void |
copyIndexFileTo(URI sourceDir,
String sourceFileName,
Directory dest,
String destFileName)
Copy an index 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 location)
This method returns the URI representation for the specified path.
|
void |
delete(URI path,
Collection<String> files,
boolean ignoreNoSuchFileException)
Delete
files at 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.
|
<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
|
void |
init(NamedList args) |
String[] |
listAll(URI dirPath)
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).
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchecksum, copyFileFrom, copyFileTo, copyIndexFileFrom, createDirectoryURI, getBackupLocation, listAllOrEmpty, resolveDirectorypublic void init(NamedList args)
init in interface NamedListInitializedPluginpublic <T> T getConfigProperty(String name)
BackupRepositorygetConfigProperty in interface BackupRepositorypublic URI createURI(String location)
BackupRepositorycreateURI in interface BackupRepositorylocation - The path specified by the user.public URI resolve(URI baseUri, String... pathComponents)
BackupRepositoryresolve in interface BackupRepositorybaseUri - The base URI to use for creating the pathpathComponents - The directory (or file-name) to be included in the URI.public void createDirectory(URI path) throws IOException
BackupRepositorycreateDirectory in interface BackupRepositorypath - The path where the directory needs to be created.IOException - in case of errorspublic void deleteDirectory(URI path) throws IOException
BackupRepositorydeleteDirectory in interface BackupRepositorypath - The path referring to the directory to be deleted.IOException - in case of errorspublic boolean exists(URI path) throws IOException
BackupRepositoryexists in interface BackupRepositorypath - The path whose existence needs to be checked.IOException - in case of errorspublic IndexInput openInput(URI dirPath, String fileName, IOContext ctx) throws IOException
BackupRepositoryopenInput in interface BackupRepositorydirPath - The parent directory of the file to be readfileName - The name of the file to be readctx - the Lucene IO contextIOException - in case of errorspublic OutputStream createOutput(URI path) throws IOException
BackupRepositorypathcreateOutput in interface BackupRepositorypath - The path for which OutputStream needs to be createdpathIOException - in case of errorspublic String[] listAll(URI dirPath) throws IOException
BackupRepositorylistAll in interface BackupRepositorydirPath - The directory pathIOException - in case of errorspublic BackupRepository.PathType getPathType(URI path) throws IOException
BackupRepositorygetPathType in interface BackupRepositorypath - The path whose type needs to be checked.IOException - in case of errorspublic void copyIndexFileFrom(Directory sourceDir, String sourceFileName, URI destDir, String destFileName) throws IOException
BackupRepositorysourceDir to the destination repository (i.e. backup).copyIndexFileFrom in interface BackupRepositorysourceDir - The source directory hosting the file to be copied.sourceFileName - The name of the file to by copieddestDir - The destination backup location.IOException - in case of errorsCorruptIndexException - in case checksum of the file does not match with precomputed checksum stored at the end of the filepublic void copyIndexFileTo(URI sourceDir, String sourceFileName, Directory dest, String destFileName) throws IOException
BackupRepositorysourceRepo to the destination directory (i.e. restore).copyIndexFileTo in interface BackupRepositorysourceDir - The source URI hosting the file to be copied.dest - The destination where the file should be copied.IOException - in case of errors.public void delete(URI path, Collection<String> files, boolean ignoreNoSuchFileException) throws IOException
BackupRepositoryfiles at pathdelete in interface BackupRepositoryIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.