Package com.cloud.bridge.service.core.s3

Examples of com.cloud.bridge.service.core.s3.S3PutObjectInlineResponse


    engineRequest.setCannedAccess( request.getHeader( "x-amz-acl" ));

    DataHandler dataHandler = new DataHandler(new ServletRequestDataSource(request));
    engineRequest.setData(dataHandler);

    S3PutObjectInlineResponse engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest(engineRequest);
    response.setHeader("ETag", "\"" + engineResponse.getETag() + "\"");
    String version = engineResponse.getVersion();
    if (null != version) response.addHeader( "x-amz-version-id", version );   
  }
View Full Code Here


      throw new IOException( e.toString());
    }
   
    // [C] Perform the request
        if (0 < countMeta) engineRequest.setMetaEntries( metaSet.toArray(new S3MetaDataEntry[0]));
    S3PutObjectInlineResponse engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest( engineRequest );
    response.setHeader("ETag", "\"" + engineResponse.getETag() + "\"");
    String version = engineResponse.getVersion();
    if (null != version) response.addHeader( "x-amz-version-id", version );   
  }
View Full Code Here

    S3PutObjectInlineRequest engineRequest = new S3PutObjectInlineRequest();
    engineRequest.setBucketName(bucket);
    engineRequest.setKey(key);
    engineRequest.setCannedAccess( cannedAccess );
    engineRequest.setMetaEntries( meta );
    S3PutObjectInlineResponse engineResponse = ServiceProvider.getInstance().getS3Engine().initiateMultipartUpload( engineRequest );
    int result = engineResponse.getResultCode();
    response.setStatus( result );
        if (200 != result) return;
       
        // -> there is no SOAP version of this function
    StringBuffer xml = new StringBuffer();
        xml.append( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" );
        xml.append( "<InitiateMultipartUploadResult xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\">" );
        xml.append( "<Bucket>" ).append( bucket ).append( "</Bucket>" );
        xml.append( "<Key>" ).append( key ).append( "</Key>" );
        xml.append( "<UploadId>" ).append( engineResponse.getUploadId()).append( "</UploadId>" );
        xml.append( "</InitiateMultipartUploadResult>" );
     
      response.setContentType("text/xml; charset=UTF-8");
      S3RestServlet.endResponse(response, xml.toString());
  }
View Full Code Here

    engineRequest.setKey(key);
    engineRequest.setContentLength(contentLength);
    DataHandler dataHandler = new DataHandler(new ServletRequestDataSource(request));
    engineRequest.setData(dataHandler);

    S3PutObjectInlineResponse engineResponse = ServiceProvider.getInstance().getS3Engine().saveUploadPart( engineRequest, uploadId, partNumber );
    if (null != engineResponse.getETag()) response.setHeader("ETag", "\"" + engineResponse.getETag() + "\"");
    response.setStatus(engineResponse.getResultCode());
  }
View Full Code Here

    engineRequest.setBucketName(bucket);
    engineRequest.setKey(key);
    engineRequest.setMetaEntries(meta);
    engineRequest.setCannedAccess(cannedAccess);

    S3PutObjectInlineResponse engineResponse = ServiceProvider.getInstance().getS3Engine().concatentateMultipartUploads( response, engineRequest, parts, os );
    int result = engineResponse.getResultCode();
    // -> free all multipart state since we now have one concatentated object
    if (200 == result) ServiceProvider.getInstance().getS3Engine().freeUploadParts( bucket, uploadId, false );
   
    // -> if all successful then clean up all left over parts
    if ( 200 == result )
      {
           StringBuffer xml = new StringBuffer();
             xml.append( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" );
             xml.append( "<CompleteMultipartUploadResult xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\">" );
             xml.append( "<Location>" ).append( "http://" + bucket + ".s3.amazonaws.com/" + key ).append( "</Location>" );
             xml.append( "<Bucket>" ).append( bucket ).append( "</Bucket>" );
             xml.append( "<Key>" ).append( key ).append( "</Key>" );
             xml.append( "<ETag>\"" ).append( engineResponse.getETag()).append( "\"</<ETag>" );
             xml.append( "</CompleteMultipartUploadResult>" );
             os.write( xml.toString().getBytes());
             os.close();
      }
    else returnErrorXML( result, null, os );
View Full Code Here

    engineRequest.setCannedAccess( request.getHeader( "x-amz-acl" ));

    DataHandler dataHandler = new DataHandler(new ServletRequestDataSource(request));
    engineRequest.setData(dataHandler);

    S3PutObjectInlineResponse engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest(engineRequest);
    response.setHeader("ETag", "\"" + engineResponse.getETag() + "\"");
    String version = engineResponse.getVersion();
    if (null != version) response.addHeader( "x-amz-version-id", version );   
  }
View Full Code Here

    engineRequest.setCannedAccess( request.getHeader( "x-amz-acl" ));

    DataHandler dataHandler = new DataHandler(new ServletRequestDataSource(request));
    engineRequest.setData(dataHandler);

    S3PutObjectInlineResponse engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest(engineRequest);
    response.setHeader("ETag", "\"" + engineResponse.getETag() + "\"");
    String version = engineResponse.getVersion();
    if (null != version) response.addHeader( "x-amz-version-id", version );   
  }
View Full Code Here

      throw new IOException( e.toString());
    }
   
    // [C] Perform the request
        if (0 < countMeta) engineRequest.setMetaEntries( metaSet.toArray(new S3MetaDataEntry[0]));
    S3PutObjectInlineResponse engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest( engineRequest );
    response.setHeader("ETag", "\"" + engineResponse.getETag() + "\"");
    String version = engineResponse.getVersion();
    if (null != version) response.addHeader( "x-amz-version-id", version );   
  }
View Full Code Here

    S3PutObjectInlineRequest engineRequest = new S3PutObjectInlineRequest();
    engineRequest.setBucketName(bucket);
    engineRequest.setKey(key);
    engineRequest.setCannedAccess( cannedAccess );
    engineRequest.setMetaEntries( meta );
    S3PutObjectInlineResponse engineResponse = ServiceProvider.getInstance().getS3Engine().initiateMultipartUpload( engineRequest );
    int result = engineResponse.getResultCode();
    response.setStatus( result );
        if (200 != result) return;
       
        // -> there is no SOAP version of this function
    StringBuffer xml = new StringBuffer();
        xml.append( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" );
        xml.append( "<InitiateMultipartUploadResult xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\">" );
        xml.append( "<Bucket>" ).append( bucket ).append( "</Bucket>" );
        xml.append( "<Key>" ).append( key ).append( "</Key>" );
        xml.append( "<UploadId>" ).append( engineResponse.getUploadId()).append( "</UploadId>" );
        xml.append( "</InitiateMultipartUploadResult>" );
     
      response.setContentType("text/xml; charset=UTF-8");
      S3RestServlet.endResponse(response, xml.toString());
  }
View Full Code Here

    engineRequest.setKey(key);
    engineRequest.setContentLength(contentLength);
    DataHandler dataHandler = new DataHandler(new ServletRequestDataSource(request));
    engineRequest.setData(dataHandler);

    S3PutObjectInlineResponse engineResponse = ServiceProvider.getInstance().getS3Engine().saveUploadPart( engineRequest, uploadId, partNumber );
    if (null != engineResponse.getETag()) response.setHeader("ETag", "\"" + engineResponse.getETag() + "\"");
    response.setStatus(engineResponse.getResultCode());
  }
View Full Code Here

TOP

Related Classes of com.cloud.bridge.service.core.s3.S3PutObjectInlineResponse

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.