Examples of listObjects()


Examples of com.amazonaws.services.s3.AmazonS3.listObjects()

    bucket.get("access_key", settings.get("cloud.aws.access_key")),
    bucket.get("secret_key", settings.get("cloud.aws.secret_key")));

    String bucketName = bucket.get("bucket");
  logger.info("--> verify encryption for bucket [{}], prefix [{}]", bucketName, basePath);
  List<S3ObjectSummary> summaries = s3Client.listObjects(bucketName, basePath).getObjectSummaries();
  for (S3ObjectSummary summary : summaries) {
      assertThat(s3Client.getObjectMetadata(bucketName, summary.getKey()).getSSEAlgorithm(), equalTo("AES256"));
  }

  logger.info("--> delete some data");
View Full Code Here

Examples of com.amazonaws.services.s3.AmazonS3.listObjects()

                while (true) {
                    ObjectListing list;
                    if (prevListing != null) {
                        list = client.listNextBatchOfObjects(prevListing);
                    } else {
                        list = client.listObjects(bucketName, basePath);
                        multiObjectDeleteRequest = new DeleteObjectsRequest(list.getBucketName());
                    }
                    for (S3ObjectSummary summary : list.getObjectSummaries()) {
                        keys.add(new DeleteObjectsRequest.KeyVersion(summary.getKey()));
                        //Every 500 objects batch the delete request
View Full Code Here

Examples of com.amazonaws.services.s3.AmazonS3.listObjects()

     * @param bucketName the bucket name.
     */
    public static void deleteBucket(final String bucketName) throws IOException {
        Properties prop = readConfig(DEFAULT_CONFIG_FILE);
        AmazonS3 s3service = openService(prop);
        ObjectListing prevObjectListing = s3service.listObjects(bucketName);
        while (true) {
            for (S3ObjectSummary s3ObjSumm : prevObjectListing.getObjectSummaries()) {
                s3service.deleteObject(bucketName, s3ObjSumm.getKey());
            }
            if (!prevObjectListing.isTruncated()) {
View Full Code Here

Examples of com.amazonaws.services.s3.AmazonS3.listObjects()

     * @param bucketName the bucket name.
     */
    public static void deleteBucket(final String bucketName) throws IOException {
        Properties prop = readConfig(DEFAULT_CONFIG_FILE);
        AmazonS3 s3service = openService(prop);
        ObjectListing prevObjectListing = s3service.listObjects(bucketName);
        while (true) {
            for (S3ObjectSummary s3ObjSumm : prevObjectListing.getObjectSummaries()) {
                s3service.deleteObject(bucketName, s3ObjSumm.getKey());
            }
            if (!prevObjectListing.isTruncated()) {
View Full Code Here

Examples of com.amazonaws.services.s3.AmazonS3Client.listObjects()

        LOG.info("delete bucket [" + bucket + "]");
        TransferManager tmx = new TransferManager(s3service);
        if (s3service.doesBucketExist(bucket)) {
            for (int i = 0; i < 3; i++) {
                tmx.abortMultipartUploads(bucket, startTime);
                ObjectListing prevObjectListing = s3service.listObjects(bucket);
                while (prevObjectListing != null ) {
                    List<DeleteObjectsRequest.KeyVersion> deleteList = new ArrayList<DeleteObjectsRequest.KeyVersion>();
                    for (S3ObjectSummary s3ObjSumm : prevObjectListing.getObjectSummaries()) {
                        deleteList.add(new DeleteObjectsRequest.KeyVersion(s3ObjSumm.getKey()));
                    }
View Full Code Here

Examples of com.amazonaws.services.s3.AmazonS3Client.listObjects()

        AmazonS3Client s3service = openService(prop);
        String bucketName = prop.getProperty(S3Constants.S3_BUCKET);
        if (!s3service.doesBucketExist(bucketName)) {
            return;
        }
        ObjectListing prevObjectListing = s3service.listObjects(bucketName);
        while (true) {
            List<DeleteObjectsRequest.KeyVersion> deleteList = new ArrayList<DeleteObjectsRequest.KeyVersion>();
            for (S3ObjectSummary s3ObjSumm : prevObjectListing.getObjectSummaries()) {
                deleteList.add(new DeleteObjectsRequest.KeyVersion(
                    s3ObjSumm.getKey()));
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.listObjects()

  public void testListObjectsNoRemove()
  {
    final Model m = ModelHelper.modelWithStatements(this,
        "a P b; b Q c; c R a");
    final NodeIterator it = m.listObjects();
    it.next();
    try
    {
      it.remove();
      Assert.fail("listObjects should not support .remove()");
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.listObjects()

   * @param removedModel
   */
  private void removeTree(Resource resource, Model removedModel) {
    Model resourceExpansion = JenaUtil.getExpandedResource(resource, 7);
    saveRemove(resource, removedModel);
    NodeIterator objects = resourceExpansion.listObjects();
    OUTER: while (objects.hasNext()) {
      RDFNode current = objects.nextNode();
      if (!(current instanceof Resource)) {
        continue;
      }
View Full Code Here

Examples of com.rackspacecloud.client.cloudfiles.FilesClient.listObjects()

     
      // Store it
      assertNotNull(client.storeObjectAs(containerName, new File(fullPath), "application/octet-stream", filename));
     
      // Make sure it's there
      List<FilesObject> objects = client.listObjects(containerName);
      assertEquals(1, objects.size());
      FilesObject obj = objects.get(0);
      assertEquals(filename, obj.getName());
      assertEquals("application/octet-stream", obj.getMimeType());
     
View Full Code Here

Examples of com.rackspacecloud.client.cloudfiles.FilesClient.listObjects()

      // Store it
      logger.info("About to save: " + filename);
      assertNotNull(client.storeObjectAs(containerName, new File(fullPath), "application/octet-stream", filename));
     
      // Make sure it's there
      List<FilesObject> objects = client.listObjects(containerName);
      assertEquals(1, objects.size());
      FilesObject obj = objects.get(0);
      assertEquals(filename, obj.getName());
      assertEquals("application/octet-stream", obj.getMimeType());
      assertEquals(NUMBER_RANDOM_BYTES, obj.getSize());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.