Package com.amazonaws.services.s3.model

Examples of com.amazonaws.services.s3.model.GetObjectRequest


    /* (non-Javadoc)
     * @see com.amazonaws.services.s3.AmazonS3#getObject(java.lang.String, java.lang.String)
     */
    public S3Object getObject(String bucketName, String key)
            throws AmazonClientException, AmazonServiceException {
        return getObject(new GetObjectRequest(bucketName, key));
    }
View Full Code Here


     * @throws AmazonServiceException
     *             If any errors occurred in Amazon S3 while processing the
     *             request.
     */
    public Download download(String bucket, String key, File file) {
        return download(new GetObjectRequest(bucket, key), file);
    }
View Full Code Here

            if ( !parentFile.exists() && !parentFile.mkdirs() ) {
                throw new RuntimeException("Couldn't create parent directories for " + f.getAbsolutePath());
            }

            downloads.add((DownloadImpl) download(
                    new GetObjectRequest(summary.getBucketName(), summary.getKey()).withGeneralProgressListener(listener), f,
                    stateChangeListener));
        }

        if ( downloads.isEmpty() ) {
            multipleFileDownload.setState(TransferState.Completed);
View Full Code Here

                        "Downloading object %1$s from bucket %2$s to temp file %3$s",
                        key, bucketName, tempFile.getName()));
            }

            try {
                connection.getObject(new GetObjectRequest(bucketName, key), tempFile);
            } catch (AmazonClientException ex) {
                // hack to handle different ETAG format generated from RiakCS for multi-part uploaded object
                String msg = ex.getMessage();
                if (!msg.contains("verify integrity")){
                    throw ex;
View Full Code Here

    dataTransferer.retrieveProduct(product, stagingDir);

    ArgumentCaptor<GetObjectRequest> argument = ArgumentCaptor.forClass(GetObjectRequest.class);
    verify(s3Client).getObject(argument.capture());

    GetObjectRequest request = argument.getValue();
    assertThat(request.getBucketName(), is(S3_BUCKET_NAME));
    assertThat(request.getKey(), is(EXPECTED_DATA_STORE_REF));
  }
View Full Code Here

  @Override
  public void retrieveProduct(Product product, File directory) throws DataTransferException,
      IOException {
    for (Reference ref : product.getProductReferences()) {
      GetObjectRequest request = new GetObjectRequest(bucketName, stripProtocol(
          ref.getDataStoreReference(), true));
      S3Object file = s3Client.getObject(request);
      stageFile(file, ref, directory);
    }
  }
View Full Code Here

  public byte[] downloadData(String sid, String cid, String id) throws StorageCloudException {
    try {
      S3Object object = null;
     
      if(sid == null){
        object = conn.getObject(new GetObjectRequest(bucketName, id));
      }else{
        sid=sid.concat(location);
        object = conn.getObject(new GetObjectRequest(sid, id));
      }
      byte[] array = getBytesFromInputStream(object.getObjectContent());

      object.getObjectContent().close();
      return array;
View Full Code Here

    /* (non-Javadoc)
     * @see com.amazonaws.services.s3.AmazonS3#getObject(java.lang.String, java.lang.String)
     */
    public S3Object getObject(String bucketName, String key)
            throws AmazonClientException, AmazonServiceException {
        return getObject(new GetObjectRequest(bucketName, key));
    }
View Full Code Here

                getLog().debug("Will not list " + summary.getKey() + ", it's a folder");
                continue;
            }
            getLog().info("Downloading metadata file '" + summary.getKey() + "' from S3...");
            final S3Object object = context.getS3Session()
                .getObject(new GetObjectRequest(s3RepositoryPath.getBucketName(), summary.getKey()));
            try {
                File targetFile =
                    new File(stagingDirectory, /*assume object key is bucket-relative path to filename with extension*/summary.getKey());
                Files.createParentDirs(targetFile);
                FileUtils.copyStreamToFile(new InputStreamFacade() {
View Full Code Here

     * @throws AmazonServiceException
     *             If any errors occurred in Amazon S3 while processing the
     *             request.
     */
    public Download download(String bucket, String key, File file) {
        return download(new GetObjectRequest(bucket, key), file);
    }
View Full Code Here

TOP

Related Classes of com.amazonaws.services.s3.model.GetObjectRequest

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.