Package org.openl.rules.repository.api
Interface FolderRepository
-
- All Superinterfaces:
AutoCloseable,Repository
- All Known Implementing Classes:
FileSystemRepository,JarLocalRepository,LocalRepository,ZippedLocalRepository
public interface FolderRepository extends Repository
Implementations of this repository can work with folders and their versions. Typically folder's version is version of the latest changed file inside that folder.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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).FileDatasave(FileData folderData, Iterable<FileItem> files, ChangesetType changesetType)Save the folder.-
Methods inherited from interface org.openl.rules.repository.api.Repository
check, checkHistory, close, copyHistory, delete, delete, deleteHistory, getId, getName, list, listHistory, read, readHistory, save, save, setListener, supports, validateConnection
-
-
-
-
Method Detail
-
listFolders
List<FileData> listFolders(String path) throws IOException
Return a list of folders in the given path (not recursively).- Parameters:
path- the folder to scan. The path must be ended by '/' or be empty.- Returns:
- the list of the folder descriptors. Invalid folders are ignored.
- Throws:
IOException- if not possible to read the directory.
-
listFiles
List<FileData> listFiles(String path, String version) throws IOException
Return a list of files recursively in the given folder and given version.- Parameters:
path- the folder to scan. The path must be ended by '/' or be empty.version- the version of the folder to read, can be null.- Returns:
- the list of the file descriptors. Invalid files are ignored.
- Throws:
IOException- if not possible to read the directory.
-
save
FileData save(FileData folderData, Iterable<FileItem> files, ChangesetType changesetType) throws IOException
Save the folder.- Parameters:
folderData- folder descriptorfiles- all files inside the folder recursively or only changed (modified, added, deleted) files depending on changesetTypechangesetType- ifChangesetType.DIFF, only changed files. IfChangesetType.FULLall files that exist in project- Returns:
- the resulted folder descriptor after successful writing.
- Throws:
IOException- if not possible to save the folder.
-
-