You can use the DocumentManagementService to manage your document repositories.
Use method
void bindRepository(IRepositoryConfiguration configuration)
to bind a new repository instance. The parameter defines the configuration of type IRepositoryConfiguration for the repository to bind.
The repository id supplied via this configuration can be freely chosen, but has to differ from currently bound repository Ids. The provider Id supplied via the configuration has to match a registered repository provider.
You can retrieve a template configuration from IRepositoryProviderInfo#getConfigurationTemplate(). This template contains keys and template values that are required for the configuration of an new repository instance.
To unbind a previously bound repository, use the following method:
void unbindRepository(String repositoryId)
Parameter is the Id of the repository instance to unbind.
In case you like to retrieve information about all bound repositories, use the following method:
List<IRepositoryInstanceInfo> getRepositoryInstanceInfos();
It returns a list of type IRepositoryInstanceInfo.
Method
List<IRepositoryProviderInfo> getRepositoryProviderInfos();
retrieves information about all available repository providers. It returns a list of type IRepositoryProviderInfo.
In case you like to set a bound repository as default repository, use the following method:
void setDefaultRepository(String repositoryId);
The given parameter is the Id of the repository instance. Path based access targets the default repository, whereas Id based access targets the repository contained in the id. An id provided by the system is always prefixed with a repository id. If the id is not provided by the system and is not prefixed with a repository id, the default repository is targeted.
To identify the currently set default repository, you can use the following method:
String getDefaultRepository();
It returns the Id of the currently set default repository.