Package net.sourceforge.js3tream.util

Examples of net.sourceforge.js3tream.util.Access


    {
      Log.info("\n");
      return;
    }
   
    Access access = new Access();
   
    /* Get the metadata for the given file */
    GetObjectResult result = null;
   
   
    /* Try a few times to get the object */
    /* Put the file, We'll try a few times */
    int attemptCount = 0;
    while (attemptCount < MAX_S3_READWRITE_ATTEMPTS)
    {
      attemptCount++;
     
      try
      {
       
        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();
       
View Full Code Here


   * create the bucket.
   **************************************************************************/
  public void createBucket() throws Exception
  {
    Log.info("Creating New Bucket: " + getBucketName() + "\n");
    Access access = new Access();
    getS3Port().createBucket(getBucketName(), null, access.getAccessKey(), access.getAccessCalendar(), access.generateSignature("CreateBucket"));
  }
View Full Code Here

    }
   

    MetadataEntry[] metaData = null;
    StorageClass storageClass = StorageClass.STANDARD;
    Access access = new Access();

    /* Setup the optional meta data */
    if (this.tag_ != null)
    {
      metaData = new MetadataEntry[1];
      metaData[0] = new MetadataEntry(META_DATA_TAG, this.tag_);
    }
   
   
      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,
                            access.getAccessKey(),
                            access.getAccessCalendar(),
                            access.generateSignature("PutObject"),
                            null);
     
             
      long endTime = System.currentTimeMillis();
     
View Full Code Here

   * @param marker
   * @return
   *******************************************************/
  public ListBucketResult getBucketKeyList(String marker) throws Exception
  {
    Access access = new Access();
   
    /* Get the list of files from S3 */
    ListBucketResult listResult = null;
   
    String prefix = null;
   
    if (getPrefixName() != null)
    {
      prefix = getPrefixName() + OBJECT_PREFIX_SEPARATOR;
    }
   
    /* Get a page of results */
    listResult = getS3Port().listBucket(getBucketName(),
                      prefix,
                      marker,
                      MAX_KEYS_PER_LIST,
                      null,
                      access.getAccessKey(),
                      access.getAccessCalendar(),
                      access.generateSignature("ListBucket"),
                      null);
   
    return listResult;
  }
View Full Code Here

    if (isPretendMode())
    {
      return;
    }
   
    Access access = new Access();
    getS3Port().deleteBucket(getBucketName(), access.getAccessKey(), access.getAccessCalendar(), access.generateSignature("DeleteBucket"), null);
  }
View Full Code Here

    if (isPretendMode())
    {
      return;
    }
   
    Access access = new Access();
    getS3Port().deleteObject(getBucketName(), key, access.getAccessKey(), access.getAccessCalendar(), access.generateSignature("DeleteObject"), null);
  }
View Full Code Here

      arch.kBytes = kBytes;
      arch.lastModifiedDate = timestamp;
     
      /* Given this is the first object found with this prefix, we'll use this
       * key to get it's metadata for the TAG value */
      Access access = new Access();
      GetObjectResult result = new AmazonS3_ServiceLocator().getAmazonS3().getObject(getBucketName(),
                                              key,
                                              true,
                                              false,
                                              false,
                                              access.getAccessKey(),
                                              access.getAccessCalendar(),
                                              access.generateSignature("GetObject"),
                                              null);
     
      /* get the meta data TAG value */
      for (int index = 0; index < result.getMetadata().length; index++)
      {
View Full Code Here

   * @param marker
   * @return
   *******************************************************/
  public ListAllMyBucketsResult getBucketList() throws Exception
  {
    Access access = new Access();
   
    /* Get the list of files from S3 */
    ListAllMyBucketsResult listResult = null;
   
    /* Get a page of results */
    listResult = getS3Port().listAllMyBuckets(
                      access.getAccessKey(),
                      access.getAccessCalendar(),
                      access.generateSignature("ListAllMyBuckets"));
   
    return listResult;
  }
View Full Code Here

   * @param marker
   * @return
   *******************************************************/
  public ListBucketResult getBucketObjectList(String marker, String bucket, String prefix, int size) throws Exception
  {
    Access access = new Access();
   
    /* Get the list of files from S3 */
    ListBucketResult listResult = null;
   
    if (prefix != null)
    {
      prefix += OBJECT_PREFIX_SEPARATOR;
    }
   
    /* Get a page of results */
    listResult = getS3Port().listBucket(bucket,
                      prefix,
                      marker,
                      size,
                      null,
                      access.getAccessKey(),
                      access.getAccessCalendar(),
                      access.generateSignature("ListBucket"),
                      null);
   
    return listResult;
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.js3tream.util.Access

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.