Package org.jets3t.service.io

Examples of org.jets3t.service.io.ProgressMonitoredInputStream


            S3Object[] objectsForUpload = new S3Object[filesToUpload.length];
            for (int i = 0; i < filesToUpload.length; i++) {
                File file = filesToUpload[i];
                log.debug("Computing MD5 hash for file: " + file);
                byte[] fileHash = ServiceUtils.computeMD5Hash(
                    new ProgressMonitoredInputStream( // Report on MD5 hash progress.
                        new FileInputStream(file), progressWatcher));
               
                S3Object object = new S3Object(null, file);
                object.setMd5Hash(fileHash);
                objectsForUpload[i] = object;
View Full Code Here


        public void run() {
            try {
                if (s3Object.getDataInputStream() != null) {
                    interruptableInputStream = new InterruptableInputStream(s3Object.getDataInputStream());
                    ProgressMonitoredInputStream pmInputStream = new ProgressMonitoredInputStream(
                        interruptableInputStream, progressMonitor);
                    s3Object.setDataInputStream(pmInputStream);
                }
                result = s3Service.putObject(bucket, s3Object);
            } catch (S3ServiceException e) {
View Full Code Here

              }

                // Setup monitoring of stream bytes tranferred.
                interruptableInputStream = new InterruptableInputStream(object.getDataInputStream());
                bufferedInputStream = new BufferedInputStream(
                    new ProgressMonitoredInputStream(interruptableInputStream, progressMonitor));
               
                bufferedOutputStream = new BufferedOutputStream(
                    downloadPackage.getOutputStream());

                try {
View Full Code Here

        public void run() {
            try {
                if (signedUrlAndObject.getObject().getDataInputStream() != null) {
                    interruptableInputStream = new InterruptableInputStream(
                        signedUrlAndObject.getObject().getDataInputStream());
                    ProgressMonitoredInputStream pmInputStream = new ProgressMonitoredInputStream(
                        interruptableInputStream, progressMonitor);
                    signedUrlAndObject.getObject().setDataInputStream(pmInputStream);
                }
                SignedUrlHandler signedPutUploader = (SignedUrlHandler) s3Service;
                result = signedPutUploader.putObjectWithSignedUrl(
View Full Code Here

            s3Object.setDataInputFile(uploadFile);
           
            // Compute the upload file's MD5 hash.
            InputStream inputStream = new BufferedInputStream(new FileInputStream(uploadFile));
            if (progressWatcher != null) {
                inputStream = new ProgressMonitoredInputStream(inputStream, progressWatcher);
            }
            s3Object.setMd5Hash(ServiceUtils.computeMD5Hash(inputStream));
           
            if (!uploadFile.equals(dataFile)) {
                // Compute the MD5 hash of the *original* file, if upload file has been altered
                // through encryption or gzipping.
                inputStream = new BufferedInputStream(new FileInputStream(dataFile));
                if (progressWatcher != null) {
                    inputStream = new ProgressMonitoredInputStream(inputStream, progressWatcher);
                }               
               
                s3Object.addMetadata(
                    S3Object.METADATA_HEADER_ORIGINAL_HASH_MD5,
                    ServiceUtils.toBase64(ServiceUtils.computeMD5Hash(inputStream)));
View Full Code Here

           
            log.debug("Transforming upload file '" + dataFile + "' to temporary file '"
                + tempUploadFile.getAbsolutePath() + "': " + actionText);
           
            if (progressWatcher != null) {
                inputStream = new ProgressMonitoredInputStream(inputStream, progressWatcher);
            }
   
            // Write transformed data to temporary file.
            byte[] buffer = new byte[8192];
            int c = -1;
View Full Code Here

                    if (computedHash == null) {
                        // A pre-computed hash file was not available, or could not be read.
                        // Calculate the hash value anew.
                        InputStream hashInputStream = null;
                        if (progressWatcher != null) {
                            hashInputStream = new ProgressMonitoredInputStream( // Report on MD5 hash progress.
                                new FileInputStream(file), progressWatcher);
                        } else {
                            hashInputStream = new FileInputStream(file);
                        }
                        computedHash = ServiceUtils.computeMD5Hash(hashInputStream);
View Full Code Here

            s3Object.setDataInputFile(uploadFile);
           
            // Compute the upload file's MD5 hash.
            InputStream inputStream = new BufferedInputStream(new FileInputStream(uploadFile));
            if (progressWatcher != null) {
                inputStream = new ProgressMonitoredInputStream(inputStream, progressWatcher);
            }
            s3Object.setMd5Hash(ServiceUtils.computeMD5Hash(inputStream));
           
            if (!uploadFile.equals(dataFile)) {
                // Compute the MD5 hash of the *original* file, if upload file has been altered
                // through encryption or gzipping.
                inputStream = new BufferedInputStream(new FileInputStream(dataFile));
                if (progressWatcher != null) {
                    inputStream = new ProgressMonitoredInputStream(inputStream, progressWatcher);
                }               
               
                s3Object.addMetadata(
                    S3Object.METADATA_HEADER_ORIGINAL_HASH_MD5,
                    ServiceUtils.toBase64(ServiceUtils.computeMD5Hash(inputStream)));
View Full Code Here

              log.debug("Transforming upload file '" + dataFile + "' to temporary file '"
                  + tempUploadFile.getAbsolutePath() + "': " + actionText);
            }
           
            if (progressWatcher != null) {
                inputStream = new ProgressMonitoredInputStream(inputStream, progressWatcher);
            }
   
            // Write transformed data to temporary file.
            byte[] buffer = new byte[8192];
            int c = -1;
View Full Code Here

            S3Object[] objectsForUpload = new S3Object[filesToUpload.length];
            for (int i = 0; i < filesToUpload.length; i++) {
                File file = filesToUpload[i];
                log.debug("Computing MD5 hash for file: " + file);
                byte[] fileHash = ServiceUtils.computeMD5Hash(
                    new ProgressMonitoredInputStream( // Report on MD5 hash progress.
                        new FileInputStream(file), progressWatcher));
               
                S3Object object = new S3Object(null, file);
                object.setMd5Hash(fileHash);
                objectsForUpload[i] = object;
View Full Code Here

TOP

Related Classes of org.jets3t.service.io.ProgressMonitoredInputStream

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.