Examples of Upload


Examples of com.alimama.web.adhoc.Upload

    HashMap<String,String> params=new HashMap<String, String>();
    Path outpath=new Path(store,String.valueOf(System.currentTimeMillis()));
    FSDataOutputStream out=fs.create(outpath);
      OutputStreamWriter osw = new OutputStreamWriter(out, "UTF-8");

    Upload up=new Upload();
    up.mergerTo(request, response, "gbk", osw, params);
    osw.close();
    out.close();
    String rtn=  addTxt(params.get("tableName"), store,params.get("callback"));
   
   
View Full Code Here

Examples of com.amazonaws.services.s3.transfer.Upload

                }

            });
            // TransferManager processes all transfers asynchronously,
            // so this call will return immediately.
            Upload upload = tm.upload(putObjectRequest);

            upload.waitForCompletion();

            // finished or aborted
            Date finish = new Date();
            String downloaded = "(incomplete download)";
            if (totalBytes >= remoteSize) {
View Full Code Here

Examples of com.amazonaws.services.s3.transfer.Upload

  }

  private static boolean upload(AmazonS3 s3, String bucketName, String destinationFile, File source)
  {
    TransferManager mgr = new TransferManager(s3);
    Upload upload = mgr.upload(bucketName, destinationFile, source);

    try {
      upload.waitForUploadResult();
    } catch (InterruptedException e) {
      return false;
    }

    return true;
View Full Code Here

Examples of com.amazonaws.services.s3.transfer.Upload

            }

            if (objectMetaData == null) {
                try {
                    // start multipart parallel upload using amazon sdk
                    Upload up = tmx.upload(new PutObjectRequest(bucket, key,
                        file));
                    // wait for upload to finish
                    if (asyncUpload) {
                        up.addProgressListener(new S3UploadProgressListener(up,
                            identifier, file, callback));
                        LOG.debug(
                            "added upload progress listener to identifier [{}]",
                            identifier);
                    } else {
                        up.waitForUploadResult();
                        LOG.debug("synchronous upload to identifier [{}] completed.", identifier);
                        if (callback != null) {
                            callback.onSuccess(new AsyncUploadResult(
                                identifier, file));
                        }
View Full Code Here

Examples of com.amazonaws.services.s3.transfer.Upload

            }

            if (objectMetaData == null) {
                try {
                    // start multipart parallel upload using amazon sdk
                    Upload up = tmx.upload(new PutObjectRequest(bucket, key,
                        file));
                    // wait for upload to finish
                    if (asyncUpload) {
                        up.addProgressListener(new S3UploadProgressListener(up,
                            identifier, file, callback));
                        LOG.debug(
                            "added upload progress listener to identifier [{}]",
                            identifier);
                    } else {
                        up.waitForUploadResult();
                        LOG.debug("synchronous upload to identifier [{}] completed.", identifier);
                        if (callback != null) {
                            callback.onSuccess(new AsyncUploadResult(
                                identifier, file));
                        }
View Full Code Here

Examples of com.amazonaws.services.s3.transfer.Upload

        }
        if (objectMetaData == null) {
            LOG.debug("   creating");
            try {
                // start multipart parallel upload using amazon sdk
                Upload up = tmx.upload(new PutObjectRequest(bucket, key, file));
                // wait for upload to finish
                up.waitForUploadResult();
                LOG.debug("   done");
            } catch (Exception e2) {
                LOG.debug("   could not upload", e2);
                throw new DataStoreException("Could not upload " + key, e2);
            }
View Full Code Here

Examples of com.amazonaws.services.s3.transfer.Upload

        }
        if (objectMetaData == null) {
            LOG.debug("   creating");
            try {
                // start multipart parallel upload using amazon sdk
                Upload up = tmx.upload(new PutObjectRequest(bucket, key, file));
                // wait for upload to finish
                up.waitForUploadResult();
                LOG.debug("   done");
            } catch (Exception e2) {
                LOG.debug("   could not upload", e2);
                throw new DataStoreException("Could not upload " + key, e2);
            }
View Full Code Here

Examples of com.amazonaws.services.s3.transfer.Upload

            }

            if (objectMetaData == null) {
                try {
                    // start multipart parallel upload using amazon sdk
                    Upload up = tmx.upload(new PutObjectRequest(bucket, key,
                        file));
                    // wait for upload to finish
                    if (asyncUpload) {
                        up.addProgressListener(new S3UploadProgressListener(
                            identifier, file, callback));
                        if (LOG.isDebugEnabled()) {
                            LOG.debug("added upload progress listener to identifier ["
                                + identifier + "]");
                        }
                    } else {
                        up.waitForUploadResult();
                        if (LOG.isDebugEnabled()) {
                            LOG.debug("synchronous upload to identifier ["
                                + identifier + "] completed.");
                        }
                        if (callback != null) {
View Full Code Here

Examples of com.amazonaws.services.s3.transfer.Upload

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug(format("Multipart sending file %1$s as S3 object %2$s in " + "bucket %3$s", sourceFile.getName(), key, bucketName));
        }
        TransferManager tm = new TransferManager(S3Utils.acquireClient(clientOptions));
        Upload upload = tm.upload(bucketName, key, sourceFile);
        upload.waitForCompletion();
    }
View Full Code Here

Examples of com.amazonaws.services.s3.transfer.Upload

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug(format("Multipart sending stream as S3 object %1$s in " + "bucket %2$s", key, bucketName));
        }
        TransferManager tm = new TransferManager(S3Utils.acquireClient(clientOptions));
        Upload upload = tm.upload(bucketName, key, sourceStream, null);
        upload.waitForCompletion();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.