public class JarLocalRepository extends Object
NOTE: This repository type doesn't support write actions!
| Constructor and Description |
|---|
JarLocalRepository() |
| 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.
|
void |
close() |
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 |
delete(List<FileData> data)
Delete multiple files or mark it as deleted in one transaction.
|
boolean |
deleteHistory(FileData data)
Delete a file from the history.
|
protected int |
getHashVersion(Path path) |
String |
getId()
Get unique identifier for Repository.
|
String |
getName()
Get repository name shown on UI.
|
void |
initialize() |
List<FileData> |
list(String path)
Return a list of files recursively in the given folder.
|
List<FileData> |
listFiles(String path,
String version)
Return a list of files recursively in the given folder and given version.
|
List<FileData> |
listFolders(String path)
Return a list of folders in the given path (not recursively).
|
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.
|
FileData |
save(FileData folderData,
Iterable<FileItem> files,
ChangesetType changesetType)
Save the folder.
|
List<FileData> |
save(List<FileItem> fileItems)
Save multiple projects in one transaction.
|
List<FileData> |
save(List<FolderItem> folderItems,
ChangesetType changesetType)
Save multiple files at once Used only in deployment services
|
void |
setId(String id) |
void |
setListener(Listener callback)
Set a listener to monitor changes in the repository.
|
void |
setName(String name) |
Features |
supports()
Get the features supported by the repository.
|
static boolean |
zipArchiveFilter(Path path)
Verifies if it's an archive
|
public void initialize()
public static boolean zipArchiveFilter(Path path)
path - path to archivetrue if it's archive, otherwise falsepublic void setId(String id)
public String getId()
RepositorygetId in interface Repositorypublic void setName(String name)
public String getName()
RepositorygetName in interface Repositorypublic void close()
close in interface Closeableclose in interface AutoCloseableclose in interface Repositorypublic List<FileData> list(String path) throws IOException
Repositorylist in interface Repositorypath - the folder to scan. The path must be ended by '/' or be empty.IOException - if not possible to read the directory.public List<FileData> listFolders(String path) throws IOException
FolderRepositorylistFolders in interface FolderRepositorypath - the folder to scan. The path must be ended by '/' or be empty.IOException - if not possible to read the directory.protected int getHashVersion(Path path) throws IOException
IOExceptionpublic List<FileData> listFiles(String path, String version) throws IOException
FolderRepositorylistFiles in interface FolderRepositorypath - the folder to scan. The path must be ended by '/' or be empty.version - the version of the folder to read, can be null.IOException - if not possible to read the directory.public FileItem read(String name) throws IOException
Repositoryread in interface Repositoryname - the path name of the file to read.IOException - if not possible to read the file.public FileData check(String name) throws IOException
Repositorycheck in interface Repositoryname - the path name of the file to read.IOException - if not possible to read the file descriptor.public FileData checkHistory(String name, String version) throws IOException
RepositoryRepository.check(String) method.checkHistory in interface Repositoryname - 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.Repository.read(String)public FileItem readHistory(String name, String version) throws IOException
RepositoryRepository.read(String) method.readHistory in interface Repositoryname - 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.Repository.read(String)public Features supports()
Repositorysupports in interface Repositorypublic FileData save(FileData folderData, Iterable<FileItem> files, ChangesetType changesetType)
FolderRepositorysave in interface FolderRepositoryfolderData - folder descriptorfiles - all files inside the folder recursively or only changed (modified, added, deleted) files depending
on changesetTypechangesetType - if ChangesetType.DIFF, only changed files. If ChangesetType.FULL all files
that exist in projectpublic List<FileData> save(List<FolderItem> folderItems, ChangesetType changesetType)
FolderRepositorysave in interface FolderRepositoryfolderItems - list of folder descriptor and its fileschangesetType - if ChangesetType.DIFF, only changed files. If ChangesetType.FULL all files
that exist in projectpublic FileData save(FileData data, InputStream stream)
Repositorysave in interface Repositorydata - the file descriptor.stream - the stream to save with the specified file descriptor.public List<FileData> save(List<FileItem> fileItems)
Repositorysave in interface RepositoryfileItems - list of file descriptor and stream pairspublic boolean delete(FileData data)
Repositorydelete in interface Repositorydata - the file descriptor to delete.public boolean delete(List<FileData> data) throws IOException
Repositorydelete in interface Repositorydata - list of files to deleteIOException - if not possible to delete the filepublic void setListener(Listener callback)
RepositorysetListener in interface Repositorycallback - the listener.public List<FileData> listHistory(String name)
RepositoryRepository.read(String) method.listHistory in interface Repositoryname - the file name.public boolean deleteHistory(FileData data)
RepositorydeleteHistory in interface Repositorydata - the file descriptor to delete. The fields "name", "version", "author" and "comment" must be
initialized.Repository.delete(FileData)public FileData copyHistory(String srcName, FileData destData, String version)
RepositorycopyHistory in interface RepositorysrcName - the file to copy.destData - the destination file descriptor.version - the version of the file to copyCopyright © 2004–2021 OpenL Tablets. All rights reserved.