Package com.microsoft.windowsazure.services.media

Examples of com.microsoft.windowsazure.services.media.WritableBlobContainerContract


        LocatorInfo locator = service.create(Locator.create(
                accessPolicy.getId(), asset.getId(), LocatorType.SAS));

        String contentKeyId = createAssetContentKey(asset, aesKey);

        WritableBlobContainerContract uploader = service
                .createBlobWriter(locator);

        Hashtable<String, AssetFileInfo> infoToUpload = new Hashtable<String, AssetFileInfo>();

        boolean isFirst = true;
        for (String fileName : inputFiles.keySet()) {
            MessageDigest digest = MessageDigest.getInstance("MD5");

            InputStream inputStream = inputFiles.get(fileName);

            byte[] iv = null;
            if (aesKey != null) {
                iv = createIV();
                inputStream = EncryptionHelper.encryptFile(inputStream, aesKey,
                        iv);
            }

            InputStream digestStream = new DigestInputStream(inputStream,
                    digest);
            CountingStream countingStream = new CountingStream(digestStream);
            uploader.createBlockBlob(fileName, countingStream);

            inputStream.close();
            byte[] md5hash = digest.digest();
            String md5 = Base64.encode(md5hash);
View Full Code Here

TOP

Related Classes of com.microsoft.windowsazure.services.media.WritableBlobContainerContract

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.