public interface Repository
| Modifier and Type | Method and Description |
|---|---|
FileData |
check(String name)
Read a file descriptor by the given path name.
|
FileData |
checkHistory(String name,
String version)
Read a file descriptor by the given path name of the given version.
|
FileData |
copy(String srcName,
FileData destData)
Copy a file to the destination file.
|
FileData |
copyHistory(String srcName,
FileData destData,
String version)
Copy a file of the given version to the destination file.
|
boolean |
delete(FileData data)
Delete a file or mark it as deleted.
|
boolean |
deleteHistory(String name,
String version)
Delete a file from the history.
|
List<FileData> |
list(String path)
Return a list of files recursively in the given folder.
|
List<FileData> |
listHistory(String name)
List a versions of the given file.
|
FileItem |
read(String name)
Read a file by the given path name.
|
FileItem |
readHistory(String name,
String version)
Read a file by the given path name of the given version.
|
FileData |
rename(String srcName,
FileData destData)
Rename or move a file.
|
FileData |
save(FileData data,
InputStream stream)
Save a file.
|
void |
setListener(Listener callback)
Set a listener to monitor changes in the repository.
|
List<FileData> list(String path) throws IOException
path - the folder to scan. The path must be ended by '/' or be
empty.IOException - if not possible to read the directory.FileData check(String name) throws IOException
name - the path name of the file to read.IOException - if not possible to read the file descriptor.FileItem read(String name) throws IOException
name - the path name of the file to read.IOException - if not possible to read the file.FileData save(FileData data, InputStream stream) throws IOException
data - the file descriptor.stream - the stream to save with the specified file descriptor.IOException - if not possible to save the file.boolean delete(FileData data)
data - the file descriptor to delete.FileData copy(String srcName, FileData destData) throws IOException
srcName - the file to copy.destData - the destination file descriptor.IOException - if not possible to copy the fileFileData rename(String srcName, FileData destData) throws IOException
srcName - the file to rename.destData - the destination file descriptor.IOException - if not possible to rename the filevoid setListener(Listener callback)
callback - the listener.List<FileData> listHistory(String name) throws IOException
read(String) method.name - the file name.IOException - if not possible to read the directory.FileData checkHistory(String name, String version) throws IOException
check(String) method.name - the path name of the file to read.version - the version of the file to read, can be null.IOException - if not possible to read the file descriptor.read(String)FileItem readHistory(String name, String version) throws IOException
read(String) method.name - the path name of the file to read.version - the version of the file to read, can be null.IOException - if not possible to read the file.read(String)boolean deleteHistory(String name, String version)
name - the file to delete.version - the version of the file to delete, can be null.delete(FileData)FileData copyHistory(String srcName, FileData destData, String version) throws IOException
copy(String, FileData) method.srcName - the file to copy.destData - the destination file descriptor.version - the version of the file to copyIOException - if not possible to copy the filecopy(String, FileData)Copyright © 2018. All rights reserved.