Skip to content

Object storage built to store and retrieve any amount of data from anywhere

License

Notifications You must be signed in to change notification settings

consiglionazionaledellericerche/storage-cloud

Repository files navigation

Artifact that allows integration with different archives and is composed of the following modules:

  1. CMIS
  2. AZURE
  3. Amazon S3
  4. Local filesystem (for test and demo purposes)

storage-cloud is released under the GNU AGPL v3 license. Maven Central

MAVEN dependency

Artifact Version
Apache Chemistry Maven Central
Spring.io Maven Central with version prefix filter
AZURE Maven Central
AMAZON S3 Maven Central

Usage

    InputStream is = IOUtils.toInputStream(TEXT, Charset.defaultCharset());
    Map<String, Object> map = new HashMap();
    map.put(StoragePropertyNames.NAME.value(), "test-file");
    map.put(StoragePropertyNames.OBJECT_TYPE_ID.value(), StoragePropertyNames.CMIS_DOCUMENT.value());
    map.put(StoragePropertyNames.SECONDARY_OBJECT_TYPE_IDS.value(), Arrays.asList(StoragePropertyNames.ASPECT_TITLED.value()));
    map.put(CM_TITLE, TITLE);
    map.put(CM_DESCRIPTION, DESCRIPTION);
    StorageObject document = storeService.storeSimpleDocument(is, "text/plain", "/", map);

    InputStream iss = storeService.getResource(document.getKey());
    assertEquals(TEXT, IOUtils.toString(iss, Charset.defaultCharset()));
    assertEquals(TITLE, document.getPropertyValue(CM_TITLE));
    assertEquals(DESCRIPTION, document.getPropertyValue(CM_DESCRIPTION));

    final String folderPath = storeService.createFolderIfNotPresent(
            "/my-path",
            "my-name",
            "my-title",
            "my-description");
    assertNotNull(folderPath);

Configuration

All configuration properties are listed here. The properties' names are dependent on the chosen driver

cnr.storage.driver=

cnr.storage.azure.connectionString=
cnr.storage.azure.containerName=

cnr.storage.filesystem.directory=

cnr.storage.s3.authUrl=
cnr.storage.s3.accessKey=
cnr.storage.s3.secretKey=
cnr.storage.s3.bucketName=
cnr.storage.s3.deleteAfter=
cnr.storage.s3.signingRegion=

CMIS properties are an exception, as they are loaded by the Chemistry library. The relevant properties are

repository.base.url=
org.apache.chemistry.opencmis.[...]=

See SessionParameter for a reference of all OpenCmis parameters. A minimal set of parameters for CMIS is

repository.base.url=
org.apache.chemistry.opencmis.session.repository.id=
org.apache.chemistry.opencmis.binding.atompub.url=
org.apache.chemistry.opencmis.binding.browser.url=
org.apache.chemistry.opencmis.binding.spi.type=
org.apache.chemistry.opencmis.binding.connecttimeout=
org.apache.chemistry.opencmis.binding.readtimeout=
org.apache.chemistry.opencmis.binding.httpinvoker.classname=
org.apache.chemistry.opencmis.user=
org.apache.chemistry.opencmis.password=

👏 How to Contribute

The main purpose of this repository is to continue evolving storage-cloud. We want to make contributing to this project as easy and transparent as possible, and we are grateful to the community for contributing bugfixes and improvements.

📄 License

storage-cloud is GNU AFFERO GENERAL PUBLIC LICENSE licensed, as found in the LICENSE file.