Package org.jets3t.service

Examples of org.jets3t.service.S3Service.listObjects()


        // List the object contents of each bucket.
        for (int b = 0; b < buckets.length; b++) {
            System.out.println("Bucket '" + buckets[b].getName() + "' contains:");
           
            // List the objects in this bucket.
            S3Object[] objects = s3Service.listObjects(buckets[b]);

            // Print out each object's key and size.
            for (int o = 0; o < objects.length; o++) {
                System.out.println(" " + objects[o].getKey() + " (" + objects[o].getContentLength() + " bytes)");
            }
View Full Code Here


        // specific objects in a bucket and you don't need to list all the bucket's contents.
       
        // List only objects whose keys match a prefix.
        String prefix = "Reports";
        String delimiter = null; // Refer to the S3 guide for more information on delimiters
        S3Object[] filteredObjects = s3Service.listObjects(testBucket, prefix, delimiter);       
       
        /*
         * Deleting objects and buckets
         */
       
View Full Code Here

        // List the object contents of each bucket.
        for (int b = 0; b < buckets.length; b++) {
            System.out.println("Bucket '" + buckets[b].getName() + "' contains:");
           
            // List the objects in this bucket.
            S3Object[] objects = s3Service.listObjects(buckets[b]);

            // Print out each object's key and size.
            for (int o = 0; o < objects.length; o++) {
                System.out.println(" " + objects[o].getKey() + " (" + objects[o].getContentLength() + " bytes)");
            }
View Full Code Here

        // specific objects in a bucket and you don't need to list all the bucket's contents.
       
        // List only objects whose keys match a prefix.
        String prefix = "Reports";
        String delimiter = null; // Refer to the S3 guide for more information on delimiters
        S3Object[] filteredObjects = s3Service.listObjects(testBucket, prefix, delimiter);       
       
        /*
         * Copying objects
         */
       
View Full Code Here

        // List the object contents of each bucket.
        for (int b = 0; b < buckets.length; b++) {
            System.out.println("Bucket '" + buckets[b].getName() + "' contains:");
           
            // List the objects in this bucket.
            S3Object[] objects = s3Service.listObjects(buckets[b]);

            // Print out each object's key and size.
            for (int o = 0; o < objects.length; o++) {
                System.out.println(" " + objects[o].getKey() + " (" + objects[o].getContentLength() + " bytes)");
            }
View Full Code Here

        // specific objects in a bucket and you don't need to list all the bucket's contents.
       
        // List only objects whose keys match a prefix.
        String prefix = "Reports";
        String delimiter = null; // Refer to the S3 guide for more information on delimiters
        S3Object[] filteredObjects = s3Service.listObjects(testBucket, prefix, delimiter);       
       
        /*
         * Copying objects
         */
       
View Full Code Here

        S3Object trickyObject = s3Service.putObject(bucket,
            new S3Object(bucket, trickyKey, "Some test data"));
        assertEquals("Tricky key name mistmatch", trickyKey, trickyObject.getKey());
       
        // Make sure the tricky named object really exists with its full name.
        S3Object[] objects = s3Service.listObjects(bucket);
        boolean trickyNamedObjectExists = false;
        for (int i = 0; !trickyNamedObjectExists && i < objects.length; i++) {
            if (trickyKey.equals(objects[i].getKey())) {
                trickyNamedObjectExists = true;
            }
View Full Code Here

        }
       
        S3Object[] objects = null;
       
        // List all items in directory.
        objects = s3Service.listObjects(bucket);       
        assertEquals("Incorrect number of objects in directory structure",
            objectsList.size(), objects.length);
       
        // List items in chunks of size 2, ensure we get a total of seven.
        int chunkedObjectsCount = 0;
View Full Code Here

            3, chunk.getObjects().length);
        assertEquals("Chunked bucket listing with prefix and delimiter retreived incorrect number of common prefixes",
            1, chunk.getCommonPrefixes().length);
       
        // List the same items with a prefix.
        objects = s3Service.listObjects(bucket, "dir1", null);       
        assertEquals("Incorrect number of objects matching prefix", 7, objects.length);
       
        // List items up one directory with a prefix (will include dir1Level1)
        objects = s3Service.listObjects(bucket, "dir1/dir1Level1", null);       
        assertEquals("Incorrect number of objects matching prefix", 4, objects.length);
View Full Code Here

        // List the same items with a prefix.
        objects = s3Service.listObjects(bucket, "dir1", null);       
        assertEquals("Incorrect number of objects matching prefix", 7, objects.length);
       
        // List items up one directory with a prefix (will include dir1Level1)
        objects = s3Service.listObjects(bucket, "dir1/dir1Level1", null);       
        assertEquals("Incorrect number of objects matching prefix", 4, objects.length);

        // List items up one directory with a prefix (will not include dir1Level1)
        objects = s3Service.listObjects(bucket, "dir1/dir1Level1/", null);       
        assertEquals("Incorrect number of objects matching prefix", 3, objects.length);
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.