Skip to content

Commit

Permalink
Replace createInputStreamMap call with countBlobs
Browse files Browse the repository at this point in the history
jclouds 1.6.0 deprecated the former.  Also specify latest release
version.
  • Loading branch information
gaul committed Dec 2, 2013
1 parent cff223c commit 6875cb8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
16 changes: 10 additions & 6 deletions blobstore-basics/pom.xml
Expand Up @@ -29,25 +29,29 @@ under the License.
<name>blobstore-basics</name>
<description>jclouds blobstore example that creates a container, then displays the size of each container</description>

<properties>
<jclouds.version>1.6.3</jclouds.version>
</properties>

<dependencies>
<dependency>
<groupId>org.jclouds</groupId>
<groupId>org.apache.jclouds</groupId>
<artifactId>jclouds-blobstore</artifactId>
<version>1.6.0</version>
<version>${jclouds.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<groupId>org.apache.jclouds</groupId>
<artifactId>jclouds-allblobstore</artifactId>
<version>1.6.0</version>
<version>${jclouds.version}</version>
</dependency>
<!-- note that if you want a smaller distribution
remove the above dependency and place something
like below -->
<!--
<dependency>
<groupId>org.jclouds.provider</groupId>
<groupId>org.apache.jclouds.provider</groupId>
<artifactId>hpcloud-objectstorage</artifactId>
<version>1.6.0</version>
<version>${jclouds.version}</version>
</dependency>
-->
</dependencies>
Expand Down
Expand Up @@ -23,7 +23,6 @@
import static com.google.common.collect.Iterables.contains;

import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.util.Set;

Expand Down Expand Up @@ -107,9 +106,8 @@ public static void main(String[] args) throws IOException {
// List Container
for (StorageMetadata resourceMd : blobStore.list()) {
if (resourceMd.getType() == StorageType.CONTAINER || resourceMd.getType() == StorageType.FOLDER) {
// Use Map API
Map<String, InputStream> containerMap = context.createInputStreamMap(resourceMd.getName());
System.out.printf(" %s: %s entries%n", resourceMd.getName(), containerMap.size());
String name = resourceMd.getName();
System.out.printf(" %s: %s entries%n", name, context.getBlobStore().countBlobs(name));
}
}

Expand Down

0 comments on commit 6875cb8

Please sign in to comment.