Package org.jclouds.blobstore

Examples of org.jclouds.blobstore.ContainerNotFoundException


            } else if (!command.getCurrentRequest().getMethod().equals("DELETE")) {
               String path = command.getCurrentRequest().getEndpoint().getPath();
               Matcher matcher = CONTAINER_PATH.matcher(path);
              
               if (matcher.find()) {
                  exception = new ContainerNotFoundException(matcher.group(1), message);
                  exception.initCause(oldException);
               } else {
                  matcher = CONTAINER_KEY_PATH.matcher(path);
                  if (matcher.find()) {
                     exception = new KeyNotFoundException(matcher.group(1), matcher.group(2), message);
View Full Code Here


               parts.remove("");
               if (parts.size() > 0) {
                  String container = parts.remove(0);
                  String query = command.getCurrentRequest().getEndpoint().getQuery();
                  if (query != null && query.indexOf("container") != -1) {
                     exception = new ContainerNotFoundException(container, message);
                  } else {
                     exception = new KeyNotFoundException(container, Joiner.on('/').join(parts), message);
                  }
               }
            }
View Full Code Here

                  String message = error != null ? error.getMessage() : String.format("%s -> %s", command.getCurrentRequest()
                        .getRequestLine(), response.getStatusLine());
                  String path = command.getCurrentRequest().getEndpoint().getPath();
                  Matcher matcher = DIRECTORY_PATH.matcher(path);
                  if (matcher.find()) {
                     exception = new ContainerNotFoundException(matcher.group(1), message);
                  } else {
                     matcher = DIRECTORY_KEY_PATH.matcher(path);
                     if (matcher.find()) {
                        exception = new KeyNotFoundException(matcher.group(1), matcher.group(2), message);
                     }
View Full Code Here

            else if (!command.getCurrentRequest().getMethod().equals("DELETE")) {
               String path = command.getCurrentRequest().getEndpoint().getPath();
               Matcher matcher = CONTAINER_PATH.matcher(path);
              
               if (matcher.find()) {
                  exception = new ContainerNotFoundException(matcher.group(1), message);
                  exception.initCause(oldException);
               } else {
                  matcher = CONTAINER_KEY_PATH.matcher(path);
                  if (matcher.find()) {
                     exception = new KeyNotFoundException(matcher.group(1), matcher.group(2), message);
View Full Code Here

               exception = new ResourceNotFoundException(message, exception);
               if (isVhostStyle && !wasPathBasedRequest) {
                  String container = command.getCurrentRequest().getEndpoint().getHost();
                  String key = command.getCurrentRequest().getEndpoint().getPath();
                  if (key == null || key.equals("/"))
                     exception = new ContainerNotFoundException(container, message);
                  else
                     exception = new KeyNotFoundException(container, key, message);
               } else if (command.getCurrentRequest().getEndpoint().getPath()
                        .indexOf(servicePath.equals("/") ? "/" : servicePath + "/") == 0) {
                  String path = command.getCurrentRequest().getEndpoint().getPath().substring(servicePath.length());
                  List<String> parts = newArrayList(Splitter.on('/').omitEmptyStrings().split(path));
                  if (parts.size() == 1) {
                     exception = new ContainerNotFoundException(parts.get(0), message);
                  } else if (parts.size() > 1) {
                     exception = new KeyNotFoundException(parts.remove(0), Joiner.on('/').join(parts), message);
                  }
               }
            }
View Full Code Here

                  String message = error != null ? error.getMessage() : String.format("%s -> %s", command.getCurrentRequest()
                        .getRequestLine(), response.getStatusLine());
                  String path = command.getCurrentRequest().getEndpoint().getPath();
                  Matcher matcher = DIRECTORY_PATH.matcher(path);
                  if (matcher.find()) {
                     exception = new ContainerNotFoundException(matcher.group(1), message);
                  } else {
                     matcher = DIRECTORY_KEY_PATH.matcher(path);
                     if (matcher.find()) {
                        exception = new KeyNotFoundException(matcher.group(1), matcher.group(2), message);
                     }
View Full Code Here

               exception = new ResourceNotFoundException(message, exception);
               if (isVhostStyle && !wasPathBasedRequest) {
                  String container = command.getCurrentRequest().getEndpoint().getHost();
                  String key = command.getCurrentRequest().getEndpoint().getPath();
                  if (key == null || key.equals("/"))
                     exception = new ContainerNotFoundException(container, message);
                  else
                     exception = new KeyNotFoundException(container, key, message);
               } else if (command.getCurrentRequest().getEndpoint().getPath()
                        .indexOf(servicePath.equals("/") ? "/" : servicePath + "/") == 0) {
                  String path = command.getCurrentRequest().getEndpoint().getPath().substring(servicePath.length());
                  List<String> parts = newArrayList(Splitter.on('/').omitEmptyStrings().split(path));
                  if (parts.size() == 1) {
                     exception = new ContainerNotFoundException(parts.get(0), message);
                  } else if (parts.size() > 1) {
                     exception = new KeyNotFoundException(parts.remove(0), Joiner.on('/').join(parts), message);
                  }
               }
            }
View Full Code Here

      return new PageSetImpl<StorageMetadata>(contents, marker);
   }

   private ContainerNotFoundException cnfe(final String name) {
      return new ContainerNotFoundException(name, String.format(
            "container %s not in %s", name,
            storageStrategy.getAllContainerNames()));
   }
View Full Code Here

      DeleteAllKeysInList testDeleter = createMockBuilder(
            DeleteAllKeysInList.class).withConstructor(executorService,
            blobStore, retryHandler, maxParallelDeletes).createMock();
      EasyMock.<PageSet<? extends StorageMetadata>> expect(blobStore.list(
                  isA(String.class), isA(ListContainerOptions.class)))
            .andThrow(new ContainerNotFoundException()).once();
      replay(blobStore);
      testDeleter.execute(containerName,
            ListContainerOptions.Builder.recursive());
      // No blobs will be deleted since blobStore.list will throw a
      // ContainerNotFoundException.
View Full Code Here

               parts.remove("");
               if (!parts.isEmpty()) {
                  String container = parts.remove(0);
                  String query = command.getCurrentRequest().getEndpoint().getQuery();
                  if (query != null && query.indexOf("container") != -1) {
                     exception = new ContainerNotFoundException(container, message);
                  } else {
                     exception = new KeyNotFoundException(container, Joiner.on('/').join(parts), message);
                  }
               }
            }
View Full Code Here

TOP

Related Classes of org.jclouds.blobstore.ContainerNotFoundException

Copyright © 2018 www.massapicom. 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.