blobStore.list(bucketName, new ListContainerOptions().recursive());
options.delimiter(delimiter); } else { options.recursive();
/** * @see ListContainerOptions#recursive() */ public static ListContainerOptions recursive() { ListContainerOptions options = new ListContainerOptions(); return options.recursive(); }
/** * @see ListContainerOptions#recursive() */ public static ListContainerOptions recursive() { ListContainerOptions options = new ListContainerOptions(); return options.recursive(); }
/** * @see ListContainerOptions#recursive() */ public static ListContainerOptions recursive() { ListContainerOptions options = new ListContainerOptions(); return options.recursive(); }
/** * @see ListContainerOptions#recursive() */ public static ListContainerOptions recursive() { ListContainerOptions options = new ListContainerOptions(); return options.recursive(); }
/** * @see ListContainerOptions#recursive() */ public static ListContainerOptions recursive() { ListContainerOptions options = new ListContainerOptions(); return options.recursive(); }
/** * @see ListContainerOptions#recursive() */ public static ListContainerOptions recursive() { ListContainerOptions options = new ListContainerOptions(); return options.recursive(); }
/** * @see ListContainerOptions#recursive() */ public static ListContainerOptions recursive() { ListContainerOptions options = new ListContainerOptions(); return options.recursive(); }
public void getStoreInfoFromProvider (BlobStore blobStore) { ListContainerOptions listOptions = new ListContainerOptions (); // returns a string containing all info of the filesystem on the cloud String temp = blobStore.list ("", listOptions.recursive ()).toString (); temp = temp.replaceFirst("\\[\\[", ""); temp = temp.replaceFirst("\\]\\]", ""); String[] parts = temp.split("\\[t"); for (String part: parts) { String[] elements = part.split(", "); System.out.println(elements.length); // ...
CrawlBlobStoreIterator(BlobStore blobStore, String containerName, ListContainerOptions options) { this.blobStore = Objects.requireNonNull(blobStore); this.containerName = Objects.requireNonNull(containerName); this.options = Objects.requireNonNull(options); if (options.getDelimiter() == null && options.getDir() == null) { this.options.recursive(); } advance(); }
@Test public void testRecursive() { ListContainerOptions options = new ListContainerOptions(); options.recursive(); assertTrue(options.isRecursive()); }
@Test public void testRecursive() { ListContainerOptions options = new ListContainerOptions(); options.recursive(); assertTrue(options.isRecursive()); }
@Override public boolean deleteApp( App app ) { log.info( "Deleting app " + app.getName() ); // Delete all files related to app for ( StorageMetadata resource : blobStore.list( config.container, prefix( app.getFolderName() ).recursive() ) ) { log.info( "Deleting app file: " + resource.getName() ); blobStore.removeBlob( config.container, resource.getName() ); } reservedNamespaces.remove( app.getActivities().getDhis().getNamespace(), app ); log.info( "Deleted app " + app.getName() ); return true; }
public void testListWithPrefix() { String containerName = "prefix"; String prefix = "foo"; blobStore.createContainerInLocation(null, containerName); blobStore.putBlob(containerName, blobStore.blobBuilder(prefix).payload("").build()); blobStore.putBlob(containerName, blobStore.blobBuilder(prefix + "bar").payload("").build()); blobStore.putBlob(containerName, blobStore.blobBuilder(prefix + "baz").payload("").build()); blobStore.putBlob(containerName, blobStore.blobBuilder("bar").payload("").build()); Iterable<? extends StorageMetadata> results = concatter.execute(containerName, ListContainerOptions.Builder.prefix(prefix)./* irrelevant */recursive()); assertThat(results).hasSize(3); assertThat(Iterables.get(results, 0).getName()).isEqualTo(prefix); assertThat(Iterables.get(results, 0).getType()).isEqualTo(StorageType.BLOB); assertThat(Iterables.get(results, 1).getName()).isEqualTo(prefix + "bar"); assertThat(Iterables.get(results, 1).getType()).isEqualTo(StorageType.BLOB); assertThat(Iterables.get(results, 2).getName()).isEqualTo(prefix + "baz"); assertThat(Iterables.get(results, 2).getType()).isEqualTo(StorageType.BLOB); }
public void testListRecursivePrefix() { String containerName = "testListRecursive"; String prefix = "foo"; blobStore.createContainerInLocation(null, containerName); blobStore.putBlob(containerName, blobStore.blobBuilder(prefix + "/object").payload("").build()); blobStore.putBlob(containerName, blobStore.blobBuilder(prefix + "bar/object").payload("") .build()); blobStore.putBlob(containerName, blobStore.blobBuilder(prefix + "baz/object").payload("") .build()); blobStore.putBlob(containerName, blobStore.blobBuilder("bar/object").payload("").build()); Iterable<? extends StorageMetadata> results = concatter.execute(containerName, ListContainerOptions.Builder.prefix(prefix).recursive()); assertThat(results).hasSize(3); assertThat(Iterables.get(results, 0).getType()).isEqualTo(StorageType.BLOB); assertThat(Iterables.get(results, 0).getName()).isEqualTo(prefix + "/object"); assertThat(Iterables.get(results, 1).getType()).isEqualTo(StorageType.BLOB); assertThat(Iterables.get(results, 1).getName()).isEqualTo(prefix + "bar/object"); assertThat(Iterables.get(results, 2).getType()).isEqualTo(StorageType.BLOB); assertThat(Iterables.get(results, 2).getName()).isEqualTo(prefix + "baz/object"); }
/** Test that listing with a marker prefix matches the first key with that prefix. */ @Test public void testListMarkerPrefix() throws Exception { BlobStore blobStore = view.getBlobStore(); final String container = getContainerName(); try { blobStore.createContainerInLocation(null, container); blobStore.putBlob(container, blobStore.blobBuilder("a/a").payload("").build()); blobStore.putBlob(container, blobStore.blobBuilder("b/b").payload("").build()); ListContainerOptions options = new ListContainerOptions().afterMarker("b/").recursive(); PageSet<? extends StorageMetadata> res = blobStore.list(container, options); assertThat(res).hasSize(1); assertThat(res.iterator().next().getName()).isEqualTo("b/b"); } finally { returnContainer(container); } }
public ListContainerOptions apply(ListBucketOptions[] optionsList) { ListContainerOptions options = new ListContainerOptions(); if (optionsList.length != 0) { if (optionsList[0].getDelimiter() == null) { options.recursive(); } else if (!optionsList[0].getDelimiter().equals("/")) { throw new IllegalArgumentException("only '/' is allowed as a blobstore delimiter"); } if (optionsList[0].getMarker() != null) { options.afterMarker(optionsList[0].getMarker()); } if (optionsList[0].getMaxResults() != null) { options.maxResults(optionsList[0].getMaxResults()); } if (optionsList[0].getPrefix() != null) { options.inDirectory(optionsList[0].getPrefix()); } } return options; } }
public ListContainerOptions apply( org.jclouds.openstack.swift.options.ListContainerOptions[] optionsList) { ListContainerOptions options = new ListContainerOptions(); if (optionsList.length != 0) { if (optionsList[0].getPath() != null && !optionsList[0].getPath().equals("")) { options.inDirectory(optionsList[0].getPath()); } if (optionsList[0].getPrefix() != null && !optionsList[0].getPrefix().equals("")) { options.inDirectory(optionsList[0].getPrefix()); options.recursive(); } if (optionsList[0].getMarker() != null) { options.afterMarker(optionsList[0].getMarker()); } options.maxResults(optionsList[0].getMaxResults()); } return options; } }
public ListContainerOptions apply(ListBlobsOptions[] optionsList) { ListContainerOptions options = new ListContainerOptions(); if (optionsList.length != 0) { if (optionsList[0].getDelimiter() == null) { options.recursive(); } else if (!optionsList[0].getDelimiter().equals("/")) { throw new IllegalArgumentException("only '/' is allowed as a blobstore delimiter"); } if (optionsList[0].getMarker() != null) { options.afterMarker(optionsList[0].getMarker()); } if (optionsList[0].getMaxResults() != null) { options.maxResults(optionsList[0].getMaxResults()); } if (optionsList[0].getPrefix() != null) { options.inDirectory(optionsList[0].getPrefix()); } if (optionsList[0].getIncludeMetadata()) { options.withDetails(); } } return options; } }