Package io.fathom.cloud.storage

Examples of io.fathom.cloud.storage.ResumableMD5Digest


            c.setStart(len);
            c.setEnd(len + blob.dataLength);
            c.setContentKey(blob.hash);
        }

        ResumableMD5Digest md5 = ResumableMD5Digest.get();
        if (file.hasHashResume() && !file.getHashResume().isEmpty()) {
            md5.setState(file.getHashResume(), file.getLength());
            md5.update(blob.data);
        } else {
            BlobStore blobStore = getBlobStore(project);

            CloudObject cloudObject = new CloudObject(oldFileData);
            try (InputStream is = cloudObject.getInputStream(blobStore)) {
                md5.update(is);
            }
            md5.update(blob.data);
        }

        ByteString hashResume = md5.getState();
        ByteString hash = ByteString.copyFrom(md5.digest());

        file.setHash(hash);

        // NOTE: hashResume can contain plaintext. Careful around encryption!
        file.setHashResume(hashResume);
View Full Code Here

TOP

Related Classes of io.fathom.cloud.storage.ResumableMD5Digest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.