class Swift extends ContentAddressableStorageAbstract {

    @Override
    public String putObject(String containerName, String objectName, InputStream stream, DigestType digestType,
        Long size) throws
        ContentAddressableStorageException {

        ParametersChecker.checkParameter(ErrorMessage.CONTAINER_OBJECT_NAMES_ARE_A_MANDATORY_PARAMETER.getMessage(),
            containerName, objectName);
        // Swift has a limit on the size of a single uploaded object; by default this is 5GB.
        // However, the download size of a single object is virtually unlimited with the concept of segmentation.
        // Segments of the larger object are uploaded and a special manifest file is created that,
        // when downloaded, sends all the segments concatenated as a single object.
        // This also offers much greater upload speed with the possibility of parallel uploads of the segments.

        SizedInputStream sis = new SizedInputStream(stream);
        Digest digest = new Digest(digestType);
        InputStream digestInputStream = digest.getDigestInputStream(sis);

        InputStream autoclose = new VitamAutoCloseInputStream(digestInputStream);
        if (size != null && size > swiftLimit) {
            bigFile(containerName, objectName, autoclose, size);
        } else {
            smallFile(containerName, objectName, autoclose);
        }

        String streamDigest = digest.digestHex();

        if (size != sis.getSize()) {
            throw new ContentAddressableStorageException(
                "Illegal state. Stream size " + sis.getSize() + " did not match expected size " + size);
        }

        String computedDigest = computeObjectDigest(containerName, objectName, digestType);
        if (!streamDigest.equals(computedDigest)) {
            throw new ContentAddressableStorageException(
                "Illegal state for container " + containerName + " and object " + objectName +
                    ". Stream digest " + streamDigest + " is not equal to computed digest " +
                    computedDigest);
        }

        storeDigest(containerName, objectName, digestType, streamDigest);
        return streamDigest;
    }

    public  Swift(Supplier<OSClient> osClient, StorageConfiguration configuration);
    @VisibleForTesting  Swift(Supplier<OSClient> osClient, StorageConfiguration configuration, Long swiftLimit);

}