Package com.amazon.s3

Examples of com.amazon.s3.MetadataEntry$Factory


      System.out.println("Unable to find file " + args[args.length -1]);
      System.exit(0);
    }
   
    try {
      PutObjectInline request = new PutObjectInline();
      request.setBucket(params.get("bucket"));
      request.setKey(params.get("name"));
      request.setContentLength(file.length());
      request.setAWSAccessKeyId("TODO");
      request.setCredential("TODO");
      request.setSignature("TODO");
      request.setTimestamp(Calendar.getInstance());
      request.setData(new DataHandler(file.toURL()));
     
      PutObjectInlineResponse response = serviceStub.putObjectInline(request);
        System.out.println("Object has been posted successfully. ETag: " + response.getPutObjectInlineResponse().getETag());
    } catch(Exception e) {
        System.out.println("Failed to execute object-put-inline due to " + e.getMessage());
View Full Code Here


      request.setCredential("TODO");
      request.setSignature("TODO");
      request.setTimestamp(Calendar.getInstance());
      request.setData(new DataHandler(file.toURL()));
     
      PutObjectInlineResponse response = serviceStub.putObjectInline(request);
        System.out.println("Object has been posted successfully. ETag: " + response.getPutObjectInlineResponse().getETag());
    } catch(Exception e) {
        System.out.println("Failed to execute object-put-inline due to " + e.getMessage());
    }
  }
View Full Code Here

        request.setBucket(args[1]);
        request.setSignature("TODO");
        request.setTimestamp(Calendar.getInstance());
       
        DeleteBucketResponse response = serviceStub.deleteBucket(request);
        Status status = response.getDeleteBucketResponse();
        if(status.getCode() == 200) {
          System.out.println("Bucket " + args[1] + " has been deleted successfully");
        } else {
          System.out.println("Unable to delete bucket " + args[1] + " - " + status.getDescription());
        }
      } catch(Exception e) {
        System.out.println("Failed to execute bucket-delete due to " + e.getMessage());
      }
  }
View Full Code Here

    /* 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();
     
View Full Code Here

        while (metadataIter.hasNext()) {
            Map.Entry entry = (Map.Entry) metadataIter.next();
            Object metadataName = entry.getKey();
            Object metadataValue = entry.getValue();
            log.debug("Setting metadata: " + metadataName + "=" + metadataValue);
            MetadataEntry mdEntry = new MetadataEntry();
            mdEntry.setName(metadataName.toString());
            mdEntry.setValue(metadataValue.toString());
            metadata[index++] = mdEntry;
        }
        return metadata;
    }
View Full Code Here

            }
           
            // Populate object's metadata details.
            MetadataEntry[] metadata = result.getMetadata();
            for (int i = 0; i < metadata.length; i++) {
                MetadataEntry entry = metadata[i];
                object.addMetadata(entry.getName(), entry.getValue());
            }
            object.setMetadataComplete(true);
           
            return object;
        } catch (RuntimeException e) {
View Full Code Here

            Object metadataName = entry.getKey();
            Object metadataValue = entry.getValue();
            if (log.isDebugEnabled()) {
              log.debug("Setting metadata: " + metadataName + "=" + metadataValue);
            }
            MetadataEntry mdEntry = new MetadataEntry();
            mdEntry.setName(metadataName.toString());
            mdEntry.setValue(metadataValue.toString());
            metadata[index++] = mdEntry;
        }
        return metadata;
    }
View Full Code Here

            }
           
            // Populate object's metadata details.
            MetadataEntry[] metadata = result.getMetadata();
            for (int i = 0; i < metadata.length; i++) {
                MetadataEntry entry = metadata[i];
                object.addMetadata(entry.getName(), entry.getValue());
            }
            object.setMetadataComplete(true);
           
            return object;
        } catch (RuntimeException e) {
View Full Code Here

            Object metadataName = entry.getKey();
            Object metadataValue = entry.getValue();
            if (log.isDebugEnabled()) {
              log.debug("Setting metadata: " + metadataName + "=" + metadataValue);
            }
            MetadataEntry mdEntry = new MetadataEntry();
            mdEntry.setName(metadataName.toString());
            mdEntry.setValue(metadataValue.toString());
            metadata[index++] = mdEntry;
        }
        return metadata;
    }
View Full Code Here

            }
           
            // Populate object's metadata details.
            MetadataEntry[] metadata = result.getMetadata();
            for (int i = 0; i < metadata.length; i++) {
                MetadataEntry entry = metadata[i];
                object.addMetadata(entry.getName(), entry.getValue());
            }
            object.setMetadataComplete(true);
           
            return object;
        } catch (RuntimeException e) {
View Full Code Here

TOP

Related Classes of com.amazon.s3.MetadataEntry$Factory

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.