[ 
https://issues.apache.org/jira/browse/JCLOUDS-1174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15486306#comment-15486306
 ] 

Andrew Gaul commented on JCLOUDS-1174:
--------------------------------------

[~ritazh] [~jasonpoon] Could you investigate this?

> Transient and Azure blob do not filter out marker blobs from blob exists
> ------------------------------------------------------------------------
>
>                 Key: JCLOUDS-1174
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1174
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-blobstore
>    Affects Versions: 1.9.2
>            Reporter: Ryan MacDowell
>              Labels: azureblob, transient
>         Attachments: DirectoryExistsTest.java
>
>
> If you create a directory in azureblob or transient, blobexists will return 
> true for that directory name.  It does not seem to filter out the marker 
> blobs.  If you create a directory in aws-s3 and call blobexists on that 
> directory name it will return false.
> Example code below
> {code}
> import org.jclouds.ContextBuilder;
> import org.jclouds.blobstore.BlobStore;
> import org.jclouds.blobstore.BlobStoreContext;
> import com.amazonaws.auth.AWSCredentials;
> import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
> //Test for equals behavior
> public class DirectoryExistsTest {
>       public static void main(String[] args) {
>               String containerName = "test.container";
>               String testDirectory = "testDirectory";
>               AWSCredentials creds = new 
> DefaultAWSCredentialsProviderChain().getCredentials();
>               //Setup the contexts
>               BlobStoreContext transientContext = 
> ContextBuilder.newBuilder("transient")
>                               .credentials(creds.getAWSAccessKeyId(), 
> creds.getAWSSecretKey())
>                               .build(BlobStoreContext.class);
>               BlobStoreContext awsS3Context = 
> ContextBuilder.newBuilder("aws-s3")
>                               .credentials(creds.getAWSAccessKeyId(), 
> creds.getAWSSecretKey())
>                               .build(BlobStoreContext.class);
>               //Setup the blobstores
>               BlobStore transientStore = transientContext.getBlobStore();
>               BlobStore awsS3Store = awsS3Context.getBlobStore();
>               //Setup the containers
>               transientStore.createContainerInLocation(null, containerName);
>               awsS3Store.createContainerInLocation(null, containerName);
>               //Setup the directories
>               transientStore.createDirectory(containerName, testDirectory);
>               awsS3Store.createDirectory(containerName, testDirectory);
>               System.out.println("Transient directory should exist " + 
> transientStore.directoryExists(containerName, testDirectory));
>               System.out.println("Transient blob should not exist " + 
> transientStore.blobExists(containerName, testDirectory));
>               System.out.println("aws-s3 directory should exist " + 
> awsS3Store.directoryExists(containerName, testDirectory));
>               System.out.println("aws-s3 blob should not exist " + 
> awsS3Store.blobExists(containerName, testDirectory));
>       }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to