Package com.amazonaws.s3.doc._2006_03_01

Examples of com.amazonaws.s3.doc._2006_03_01.GetObjectResult


 
  private GetObjectResponse toGetObjectResponse(S3GetObjectResponse engineResponse) {
    GetObjectResponse response = new GetObjectResponse();
    int resultCode = engineResponse.getResultCode();

    GetObjectResult result = new GetObjectResult();
    Status param1 = new Status();
    param1.setCode( resultCode);
    param1.setDescription( engineResponse.getResultDescription());
    result.setStatus( param1 );
   
    if ( 200 == resultCode )
    {
         result.setData(engineResponse.getData());
         result.setETag( engineResponse.getETag());
         result.setMetadata(toMetadataEntry(engineResponse.getMetaEntries()));
         result.setLastModified( engineResponse.getLastModified());
    }
    else
    {    result.setETag( "" );
       result.setLastModified( Calendar.getInstance())
    }
     
    response.setGetObjectResponse(result);
    return response;
  }
View Full Code Here


 
  private GetObjectExtendedResponse toGetObjectExtendedResponse(S3GetObjectResponse engineResponse) {
    GetObjectExtendedResponse response = new GetObjectExtendedResponse();
    int resultCode = engineResponse.getResultCode();

    GetObjectResult result = new GetObjectResult();
    Status param1 = new Status();
    param1.setCode( resultCode );
    param1.setDescription( engineResponse.getResultDescription());
    result.setStatus( param1 );

    if ( 200 == resultCode || 206 == resultCode )
    {
         result.setData(engineResponse.getData());
         result.setETag( engineResponse.getETag());
         result.setMetadata(toMetadataEntry(engineResponse.getMetaEntries()));
         result.setLastModified( engineResponse.getLastModified());
    }
    else
    {    result.setETag( "" );
       result.setLastModified( Calendar.getInstance())
    }
   
    response.setGetObjectResponse(result);
    return response;
  }
View Full Code Here

    private GetObjectResponse toGetObjectResponse(S3GetObjectResponse engineResponse) {
        GetObjectResponse response = new GetObjectResponse();
        int resultCode = engineResponse.getResultCode();

        GetObjectResult result = new GetObjectResult();
        Status param1 = new Status();
        param1.setCode(resultCode);
        param1.setDescription(engineResponse.getResultDescription());
        result.setStatus(param1);

        if (200 == resultCode) {
            result.setData(engineResponse.getData());
            result.setETag(engineResponse.getETag());
            result.setMetadata(toMetadataEntry(engineResponse.getMetaEntries()));
            result.setLastModified(engineResponse.getLastModified());
        } else {
            result.setETag("");
            result.setLastModified(Calendar.getInstance());
        }

        response.setGetObjectResponse(result);
        return response;
    }
View Full Code Here

    private GetObjectExtendedResponse toGetObjectExtendedResponse(S3GetObjectResponse engineResponse) {
        GetObjectExtendedResponse response = new GetObjectExtendedResponse();
        int resultCode = engineResponse.getResultCode();

        GetObjectResult result = new GetObjectResult();
        Status param1 = new Status();
        param1.setCode(resultCode);
        param1.setDescription(engineResponse.getResultDescription());
        result.setStatus(param1);

        if (200 == resultCode || 206 == resultCode) {
            result.setData(engineResponse.getData());
            result.setETag(engineResponse.getETag());
            result.setMetadata(toMetadataEntry(engineResponse.getMetaEntries()));
            result.setLastModified(engineResponse.getLastModified());
        } else {
            result.setETag("");
            result.setLastModified(Calendar.getInstance());
        }

        response.setGetObjectResponse(result);
        return response;
    }
View Full Code Here

 
  private GetObjectResponse toGetObjectResponse(S3GetObjectResponse engineResponse) {
    GetObjectResponse response = new GetObjectResponse();
    int resultCode = engineResponse.getResultCode();

    GetObjectResult result = new GetObjectResult();
    Status param1 = new Status();
    param1.setCode( resultCode);
    param1.setDescription( engineResponse.getResultDescription());
    result.setStatus( param1 );
   
    if ( 200 == resultCode )
    {
         result.setData(engineResponse.getData());
         result.setETag( engineResponse.getETag());
         result.setMetadata(toMetadataEntry(engineResponse.getMetaEntries()));
         result.setLastModified( engineResponse.getLastModified());
    }
    else
    {    result.setETag( "" );
       result.setLastModified( Calendar.getInstance())
    }
     
    response.setGetObjectResponse(result);
    return response;
  }
View Full Code Here

 
  private GetObjectExtendedResponse toGetObjectExtendedResponse(S3GetObjectResponse engineResponse) {
    GetObjectExtendedResponse response = new GetObjectExtendedResponse();
    int resultCode = engineResponse.getResultCode();

    GetObjectResult result = new GetObjectResult();
    Status param1 = new Status();
    param1.setCode( resultCode );
    param1.setDescription( engineResponse.getResultDescription());
    result.setStatus( param1 );

    if ( 200 == resultCode || 206 == resultCode )
    {
         result.setData(engineResponse.getData());
         result.setETag( engineResponse.getETag());
         result.setMetadata(toMetadataEntry(engineResponse.getMetaEntries()));
         result.setLastModified( engineResponse.getLastModified());
    }
    else
    {    result.setETag( "" );
       result.setLastModified( Calendar.getInstance())
    }
   
    response.setGetObjectResponse(result);
    return response;
  }
View Full Code Here

       
        long startTime = System.currentTimeMillis();
       
       
        AmazonS3_ServiceLocator locator = new AmazonS3_ServiceLocator();
        AmazonS3SoapBindingStub binding = new AmazonS3SoapBindingStub(new URL(locator.getAmazonS3Address()), locator);
       
        result = binding.getObject(getBucketName(),
                      key,
                      false,
                      true,
                      false,
                      access.getAccessKey(),
                      access.getAccessCalendar(),
                      access.generateSignature("GetObject"),
                      null);
       
       
        long endTime = System.currentTimeMillis();
       
               
        /* Get the attachments. Note, the getAttachments() method will ONLY return the object[] on the first call.  Subsiquent calls will return null */
        Object[] attachments = binding.getAttachments();
        if (attachments.length != 1)
        {
          throw new Exception("The S3 Object returned [" + attachments.length + "] when we expected exactly 1");
        }
       
View Full Code Here

   
      long startTime = System.currentTimeMillis();
     
     
      AmazonS3_ServiceLocator locator = new AmazonS3_ServiceLocator();
      AmazonS3SoapBindingStub binding = new AmazonS3SoapBindingStub(new URL(locator.getAmazonS3Address()), locator);
      DataHandler dataHandler = new DataHandler(new SourceDataSource(null, MIMETYPE_OCTET_STREAM, new StreamSource(is)));
            binding.addAttachment(dataHandler);
     
      PutObjectResult result = binding.putObject(getBucketName(),
                            key,
                            metaData ,
                            length,
                            null,
                            storageClass,
View Full Code Here

   *******************************************************/
  public AmazonS3_PortType getS3Port() throws Exception
  {
    if (this.s3Port_ == null)
    {
      this.s3Port_ = new AmazonS3_ServiceLocator().getAmazonS3();
    }
   
    return this.s3Port_;
  }
View Full Code Here

   * to obtain the already created port.
   * @return
   *******************************************************/
  public AmazonS3_PortType createS3Port(String endpoint) throws Exception
  {
    AmazonS3_ServiceLocator loc = new AmazonS3_ServiceLocator();
    loc.setAmazonS3EndpointAddress(endpoint);
    this.s3Port_ = loc.getAmazonS3();
    return this.s3Port_;
  }
View Full Code Here

TOP

Related Classes of com.amazonaws.s3.doc._2006_03_01.GetObjectResult

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.