Skip to content
Permalink
Browse files
Replace createInputStreamMap call with countBlobs
jclouds 1.6.0 deprecated the former.  Also specify latest release
version.
  • Loading branch information
gaul committed Dec 2, 2013
1 parent cff223c commit 6875cb8da20cef0ad50c38798b77309ac92c5d27
Showing 2 changed files with 12 additions and 10 deletions.
@@ -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>
@@ -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;

@@ -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));
}
}

0 comments on commit 6875cb8

Please sign in to comment.