Package org.jclouds.blobstore

Examples of org.jclouds.blobstore.BlobStore.blobExists()


   @Override
   protected Object doExecute() throws Exception {
      BlobStore blobStore = getBlobStore();

      if (!blobStore.blobExists(containerName, blobName)) {
          throw new KeyNotFoundException(containerName, blobName, "while checking existence");
      }
      return null;
   }
}
View Full Code Here


                if (blobStore == null) {
                    throw new IOException("BlobStore service not available for provider " + providerOrApi);
                }
                if (!blobStore.containerExists(containerName)) {
                    throw new IOException("Container " + containerName + " does not exists");
                } else if (!blobStore.blobExists(containerName, blobName)) {
                    throw new IOException("Blob " + blobName + " does not exists");
                }

                Blob blob = blobStore.getBlob(containerName, blobName);
View Full Code Here

  public synchronized void putIfAbsent(File file) throws FileNotFoundException {
      allocateContainer();

      BlobStore store = context.getBlobStore();
      if (!store.blobExists(container, file.getName())) {
        LOG.info("Uploading '{}' to '{}' blob cache.", file.getName(), container);

        Blob blob = context.getBlobStore().blobBuilder(container)
                .name(file.getName())
                .payload(file)
View Full Code Here

  public synchronized void putIfAbsent(String name, InputStream in, long contentLength) {
    allocateContainer();

    BlobStore store = context.getBlobStore();
    if (!store.blobExists(container, name)) {
      LOG.info("Uploading '{}' to '{}' blob cache.", name, container);

      Blob blob = context.getBlobStore().newBlob(name);
      blob.setPayload(in);
      blob.getMetadata().getContentMetadata().setContentLength(contentLength);
View Full Code Here

  public synchronized void putIfAbsent(File file) throws FileNotFoundException {
      allocateContainer();

      BlobStore store = context.getBlobStore();
      if (!store.blobExists(container, file.getName())) {
        LOG.info("Uploading '{}' to '{}' blob cache.", file.getName(), container);

        Blob blob = context.getBlobStore().blobBuilder(container)
                .name(file.getName())
                .payload(file)
View Full Code Here

  public synchronized void putIfAbsent(File file) throws FileNotFoundException {
      allocateContainer();

      BlobStore store = context.getBlobStore();
      if (!store.blobExists(container, file.getName())) {
        LOG.info("Uploading '{}' to '{}' blob cache.", file.getName(), container);

        Blob blob = context.getBlobStore().blobBuilder(container)
                .name(file.getName())
                .payload(file)
View Full Code Here

                @Override
                public Writer updateEntity( final EntityReference ref, EntityDescriptor entityDescriptor )
                    throws IOException
                {
                    if( !blobStore.blobExists( container, ref.identity() ) )
                    {
                        throw new EntityNotFoundException( ref );
                    }
                    return new StringWriter()
                    {
View Full Code Here

                @Override
                public void removeEntity( EntityReference ref, EntityDescriptor entityDescriptor )
                    throws EntityNotFoundException
                {
                    if( !blobStore.blobExists( container, ref.identity() ) )
                    {
                        throw new EntityNotFoundException( ref );
                    }
                    blobStore.removeBlob( container, ref.identity() );
                }
View Full Code Here

   @Override
   protected Object doExecute() throws Exception {
      BlobStore blobStore = getBlobStore();

      if (!blobStore.blobExists(containerName, blobName)) {
          throw new KeyNotFoundException(containerName, blobName, "while checking existence");
      }
      return null;
   }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.