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 |
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(FileData data)
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 |
save(FileData data,
InputStream stream)
Save a file.
|
List<FileData> |
save(List<FileItem> fileItems)
Save multiple projects in one transaction.
|
void |
setListener(Listener callback)
Set a listener to monitor changes in the repository.
|
Features |
supports()
Get the features supported by 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.List<FileData> save(List<FileItem> fileItems) throws IOException
fileItems - list of file descriptor and stream pairsIOException - if not possible to save the file.boolean delete(FileData data) throws IOException
data - the file descriptor to delete.IOException - if not possible to delete the file.void 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(FileData data) throws IOException
data - the file descriptor to delete. The fields "name", "version", "author" and "comment" must be
initialized.IOException - if not possible to delete the file.delete(FileData)FileData copyHistory(String srcName, FileData destData, String version) throws IOException
srcName - the file to copy.destData - the destination file descriptor.version - the version of the file to copyIOException - if not possible to copy the fileFeatures supports()
Copyright © 2004–2020 OpenL Tablets. All rights reserved.