mirror of https://github.com/apache/jclouds.git
JCLOUDS-930: Plumb prefix support down to Azure.
Plumbs support for the prefix query option in the Azure provider. This option is not compatible with the "directory" list option and an exception is thrown if both are set.
This commit is contained in:
parent
8677ffcb21
commit
497a013c8a
|
@ -30,6 +30,9 @@ public class ListOptionsToListBlobsOptions implements
|
|||
Function<ListContainerOptions, ListBlobsOptions> {
|
||||
public ListBlobsOptions apply(ListContainerOptions from) {
|
||||
checkNotNull(from, "set options to instance NONE instead of passing null");
|
||||
if (from.getDir() != null && from.getPrefix() != null) {
|
||||
throw new IllegalArgumentException("Cannot set both directory and prefix");
|
||||
}
|
||||
ListBlobsOptions httpOptions = new ListBlobsOptions();
|
||||
if (!from.isRecursive()) {
|
||||
httpOptions.delimiter("/");
|
||||
|
@ -37,6 +40,9 @@ public class ListOptionsToListBlobsOptions implements
|
|||
if (from.getDir() != null) {
|
||||
httpOptions.prefix(from.getDir().endsWith("/") ? from.getDir() : from.getDir() + "/");
|
||||
}
|
||||
if (from.getPrefix() != null) {
|
||||
httpOptions.prefix(from.getPrefix());
|
||||
}
|
||||
if (from.getMarker() != null) {
|
||||
httpOptions.marker(from.getMarker());
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
package org.jclouds.azureblob.blobstore.integration;
|
||||
|
||||
import org.jclouds.blobstore.integration.internal.BaseContainerLiveTest;
|
||||
import org.testng.SkipException;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@Test(groups = { "live" })
|
||||
|
@ -25,9 +24,4 @@ public class AzureBlobContainerLiveTest extends BaseContainerLiveTest {
|
|||
public AzureBlobContainerLiveTest() {
|
||||
provider = "azureblob";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void testContainerListWithPrefix() {
|
||||
throw new SkipException("Prefix option has not been plumbed down to Azure");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue