You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jclouds.apache.org by joe meiring <jo...@gmail.com> on 2018/10/17 19:05:56 UTC

BlobStore.clearContainer()

I'm using 2.1.1 of jClouds to remove contents of a bucket using
clearContainer(container, ListContainerOptions). I'm getting a "Prefix and
delimiter support has not yet been added" Exception if there is a prefix,
although the docs seem to indicate it should work.

https://jclouds.apache.org/reference/javadoc/2.1.x/org/jclouds/blobstore/BlobStore.html#clearContainer

If that doesn't work, what is the best way to remove everything under a
prefix with jClouds?

Thanks,

Re: BlobStore.clearContainer()

Posted by joe meiring <jo...@gmail.com>.
Sure, I'll give it a try. Is there some way to get on the jclouds slack
channel?

Cheers,
Joe

On Wed, Oct 17, 2018 at 4:35 PM Andrew Gaul <ga...@apache.org> wrote:

> On Wed, Oct 17, 2018 at 02:05:56PM -0500, joe meiring wrote:
> > I'm using 2.1.1 of jClouds to remove contents of a bucket using
> > clearContainer(container, ListContainerOptions). I'm getting a "Prefix
> and
> > delimiter support has not yet been added" Exception if there is a prefix,
> > although the docs seem to indicate it should work.
> >
> >
> https://jclouds.apache.org/reference/javadoc/2.1.x/org/jclouds/blobstore/BlobStore.html#clearContainer
> >
> > If that doesn't work, what is the best way to remove everything under a
> > prefix with jClouds?
>
> I do not understand why DeleteAllKeysInList.execute eager throws an
> exception here; DeleteAllKeysInList.getListing passes
> ListContainerOptions to BlobStore.list so I believe this should just
> work if you remove the check.  Could you test this and report it in a
> JIRA issue?  Pull requests welcome, of course!
>
> Speculating, this code was written back when jclouds only supported
> pseudo-directories, a least common denominator since Atmos does not
> support prefixes.  Fast-forwarding to today, all providers except Atmos
> support prefix and delimeter so we should not constrain them by an
> abandoned API's quirks.  I believe the existing implementation can be
> substantially simplified.
>
> --
> Andrew Gaul
> http://gaul.org/
>

Re: BlobStore.clearContainer()

Posted by Andrew Gaul <ga...@apache.org>.
On Wed, Oct 17, 2018 at 02:05:56PM -0500, joe meiring wrote:
> I'm using 2.1.1 of jClouds to remove contents of a bucket using
> clearContainer(container, ListContainerOptions). I'm getting a "Prefix and
> delimiter support has not yet been added" Exception if there is a prefix,
> although the docs seem to indicate it should work.
> 
> https://jclouds.apache.org/reference/javadoc/2.1.x/org/jclouds/blobstore/BlobStore.html#clearContainer
> 
> If that doesn't work, what is the best way to remove everything under a
> prefix with jClouds?

I do not understand why DeleteAllKeysInList.execute eager throws an
exception here; DeleteAllKeysInList.getListing passes
ListContainerOptions to BlobStore.list so I believe this should just
work if you remove the check.  Could you test this and report it in a
JIRA issue?  Pull requests welcome, of course!

Speculating, this code was written back when jclouds only supported
pseudo-directories, a least common denominator since Atmos does not
support prefixes.  Fast-forwarding to today, all providers except Atmos
support prefix and delimeter so we should not constrain them by an
abandoned API's quirks.  I believe the existing implementation can be
substantially simplified.

-- 
Andrew Gaul
http://gaul.org/