Package org.jets3t.service.impl.rest.httpclient

Examples of org.jets3t.service.impl.rest.httpclient.RestStorageService.listObjects()


            assertEquals(objects.length, createObjectsEventCount[0]);
            assertEquals(objects.length, getObjectHeadsEventCount[0]);
            assertEquals(objects.length, getObjectsList.size());
            assertEquals(objects.length, deleteObjectsEventCount[0]);

            StorageObject[] listedObjects = service.listObjects(bucketName);
            assertEquals(0, listedObjects.length);
        } finally {
            cleanupBucketForTest("testThreadedStorageService");
        }
    }
View Full Code Here


            };

            // Upload multiple objects
            StorageObject[] putObjects =
                simpleThreadedService.putObjects(bucketName, objects);
            StorageObject[] listedObjects = service.listObjects(bucketName);
            assertEquals(objects.length, listedObjects.length);

            // Retrieve details for multiple objects
            StorageObject[] headObjects = simpleThreadedService.getObjectsHeads(bucketName, objects);
            assertEquals(objects.length, headObjects.length);
View Full Code Here

                    getObjects[i].getDataInputStream(), Constants.DEFAULT_ENCODING));
            }

            // Delete multiple objects
            simpleThreadedService.deleteObjects(bucketName, objects);
            listedObjects = service.listObjects(bucketName);
            assertEquals(0, listedObjects.length);
        } finally {
            cleanupBucketForTest("testSimpleThreadedStorageService");
        }
    }
View Full Code Here

    }

    protected void deleteAllObjectsInBucket(String bucketName) {
        try {
            RestStorageService service = getStorageService(getCredentials());
            for (StorageObject o: service.listObjects(bucketName)) {
                service.deleteObject(bucketName, o.getKey());
            }
        } catch (Exception e) {
            // This shouldn't happen, but if it does don't ruin the test
            e.printStackTrace();
View Full Code Here

            StorageObject trickyObject = service.putObject(bucketName,
                new StorageObject(trickyKey, "Some test data"));
            assertEquals("Tricky key name mistmatch", trickyKey, trickyObject.getKey());

            // Make sure the tricky named object really exists with its full name.
            StorageObject[] objects = service.listObjects(bucketName);
            boolean trickyNamedObjectExists = false;
            for (int i = 0; !trickyNamedObjectExists && i < objects.length; i++) {
                if (trickyKey.equals(objects[i].getKey())) {
                    trickyNamedObjectExists = true;
                }
View Full Code Here

                    );
                copyResults.add(copyResult);
                copiedObject = service.getObjectDetails(
                    targetBucketName, targetObject.getName());
            }
            assertEquals(4, service.listObjects(targetBucketName).length);
            // Check results map from copy operation
            Map<String, Object> firstCopyResult = copyResults.get(0);
            assertEquals("\"5d11eb8a313fc3e205fef245b7be06c7\"",
                firstCopyResult.get("ETag"));
            assertEquals(sourceBucketName,
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.