Interface IRepositoryWriter
- All Known Subinterfaces:
IRepository
public interface IRepositoryWriter
This interface represents a Repository. It allows for querying, modifying and
navigating through collections and resources.
-
Method Summary
Modifier and Type Method Description ICollectioncreateCollection(String path)This method creates a new empty collection at the specified path.IResourcecreateResource(String path)This method creates a new empty resource at the specified path.IResourcecreateResource(String path, byte[] content)This method creates a new resource at the specified path and fills it with the specified content.IResourcecreateResource(String path, byte[] content, boolean isBinary, String contentType)This method creates a new empty resource at the specified path.IResourcecreateResource(String path, byte[] content, boolean isBinary, String contentType, boolean override)This method creates a new empty, or override resource at the specified path.voiddeleteLinkedPath(String repositoryPath)Delete link together with external folder or file.voiddispose()Disposes of this repository.booleanisLinkedPath(String repositoryPath)Check if Link exists between folder or file and an internal Repository artifact.booleanisLinkingPathsSupported()Whether the Repository supports linking of external paths.voidlinkPath(String repositoryPath, String filePath)Link external folder or file as an internal Repository artifact.voidremoveCollection(String path)This method removes the collection with the specified path from the repository.voidremoveResource(String path)This method removes the resource at the specified path from the repository.
-
Method Details
-
createCollection
This method creates a new empty collection at the specified path.The returned value is an instance of
ICollectionwhich represents the newly created collection.- Parameters:
path-ICollectionlocation- Returns:
- an
ICollectioninstance - Throws:
RepositoryWriteException- in case theICollectioncannot be created
-
removeCollection
This method removes the collection with the specified path from the repository.- Parameters:
path- theICollectionlocation- Throws:
RepositoryWriteException- in case theICollectioncannot be removed
-
createResource
This method creates a new empty resource at the specified path.The returned value is an instance of
IResourcethat represents the newly created resource.- Parameters:
path- theIResourcelocation- Returns:
- an
IResourceinstance - Throws:
RepositoryWriteException- in caseIResourcecannot be created
-
createResource
This method creates a new resource at the specified path and fills it with the specified content.The returned value is an instance of
IResourcethat represents the newly created resource.- Parameters:
path- theIResourcelocationcontent- the raw content- Returns:
- an
IResourceinstance - Throws:
RepositoryWriteException- in caseIResourcecannot be created
-
createResource
IResource createResource(String path, byte[] content, boolean isBinary, String contentType) throws RepositoryWriteExceptionThis method creates a new empty resource at the specified path.The returned value is an instance of
IResourcethat represents the newly created resource.- Parameters:
path- theIResourcelocationcontent- the raw contentisBinary- whether it is binarycontentType- the type of the content- Returns:
- an
IResourceinstance - Throws:
RepositoryWriteException- in case theIResourcecannot be created
-
createResource
IResource createResource(String path, byte[] content, boolean isBinary, String contentType, boolean override) throws RepositoryWriteExceptionThis method creates a new empty, or override resource at the specified path.The returned value is an instance of
IResourcethat represents the newly created resource.- Parameters:
path- theIResourcelocationcontent- the raw contentisBinary- whether it is binarycontentType- the type of the contentoverride- whether to override existing- Returns:
- an
IResourceinstance - Throws:
RepositoryWriteException- in case theIResourcecannot be created
-
removeResource
This method removes the resource at the specified path from the repository.- Parameters:
path- theIResourcelocation- Throws:
RepositoryWriteException- in case theIResourcecannot be removed
-
dispose
void dispose()Disposes of this repository.Calling this method allows for the repository to release all allocated resources.
Calling this method more than once will be a no-op.
-
isLinkingPathsSupported
boolean isLinkingPathsSupported()Whether the Repository supports linking of external paths.- Returns:
- true, if is linking paths supported
-
linkPath
Link external folder or file as an internal Repository artifact.- Parameters:
repositoryPath- the relative pathfilePath- the target folder or file- Throws:
IOException- in case of exception
-
deleteLinkedPath
Delete link together with external folder or file.- Parameters:
repositoryPath- the relative path- Throws:
IOException- in case of exception
-
isLinkedPath
Check if Link exists between folder or file and an internal Repository artifact.- Parameters:
repositoryPath- the relative path- Returns:
- true if link exists
-