diff --git a/demos/createandlistbuckets/README.txt b/demos/createandlistbuckets/README.txt deleted file mode 100755 index e21edf3a3a..0000000000 --- a/demos/createandlistbuckets/README.txt +++ /dev/null @@ -1,25 +0,0 @@ -==== - - Copyright (C) 2010 Cloud Conscious, LLC. - - ==================================================================== - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ==================================================================== -==== - -# -# this is a simple example command line client that creates a bucket, then displays all buckets you own -# 1. execute 'mvn install' to build the sample -# 2. invoke the jar, passing your aws credentials and the bucket you wish to create -# ex. -# java -jar target/jclouds-aws-demo-createandlistbuckets-jar-with-dependencies.jar $AWS_USER $AWS_PWD testbucketmeo diff --git a/demos/createandlistbuckets/pom.xml b/demos/createandlistbuckets/pom.xml deleted file mode 100644 index cfc4f6b7ff..0000000000 --- a/demos/createandlistbuckets/pom.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - 4.0.0 - - org.jclouds - demos-project - 1.0-SNAPSHOT - - createandlistbuckets - jclouds S3 sample that creates a bucket then lists all owned buckets - jclouds S3 sample that creates a bucket then lists all owned buckets - - - org.jclouds.api - s3 - ${project.version} - - - - ${project.artifactId} - - - - org.apache.maven.plugins - maven-jar-plugin - - - - org.jclouds.aws.s3.samples.MainApp - - - - - - - maven-assembly-plugin - - - jar-with-dependencies - - - - org.jclouds.aws.s3.samples.MainApp - - - - - - make-assembly - package - - single - - - - - - - - - diff --git a/demos/createandlistbuckets/src/main/java/org/jclouds/aws/s3/samples/MainApp.java b/demos/createandlistbuckets/src/main/java/org/jclouds/aws/s3/samples/MainApp.java deleted file mode 100755 index 52d6c077e7..0000000000 --- a/demos/createandlistbuckets/src/main/java/org/jclouds/aws/s3/samples/MainApp.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * - * Copyright (C) 2010 Cloud Conscious, LLC. - * - * ==================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ==================================================================== - */ - -package org.jclouds.aws.s3.samples; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Map; - -import org.jclouds.s3.S3AsyncClient; -import org.jclouds.s3.S3Client; -import org.jclouds.blobstore.BlobStore; -import org.jclouds.blobstore.BlobStoreContext; -import org.jclouds.blobstore.BlobStoreContextFactory; -import org.jclouds.blobstore.domain.Blob; -import org.jclouds.blobstore.domain.StorageMetadata; -import org.jclouds.blobstore.domain.StorageType; -import org.jclouds.rest.RestContext; - -/** - * This the Main class of an Application that demonstrates the use of the blobstore. - * - * Usage is: java MainApp \"accesskeyid\" \"secretkey\" \"bucketName\" - * - * @author Carlos Fernandes - * @author Adrian Cole - */ -public class MainApp { - - public static int PARAMETERS = 3; - public static String INVALID_SYNTAX = "Invalid number of parameters. Syntax is: \"accesskeyid\" \"secretkey\" \"bucketName\" "; - - public static void main(String[] args) throws IOException { - - if (args.length < PARAMETERS) - throw new IllegalArgumentException(INVALID_SYNTAX); - - // Args - String accesskeyid = args[0]; - String secretkey = args[1]; - String containerName = args[2]; - - // Init - BlobStoreContext context = new BlobStoreContextFactory().createContext("s3", accesskeyid, - secretkey); - - try { - - // Create Container - BlobStore blobStore = context.getBlobStore(); - blobStore.createContainerInLocation(null, containerName); - - // Add Blob - Blob blob = blobStore.newBlob("test"); - blob.setPayload("testdata"); - blobStore.putBlob(containerName, blob); - - // List Container - for (StorageMetadata resourceMd : blobStore.list()) { - if (resourceMd.getType() == StorageType.CONTAINER - || resourceMd.getType() == StorageType.FOLDER) { - // Use Map API - Map containerMap = context.createInputStreamMap(resourceMd - .getName()); - System.out.printf(" %s: %s entries%n", resourceMd.getName(), containerMap.size()); - } - } - - // Use Provider API - RestContext providerContext = context - .getProviderSpecificContext(); - providerContext.getApi().getBucketLogging(containerName); - - } finally { - // Close connecton - context.close(); - System.exit(0); - } - - } -}