Refine search
@Override public BlobAccess getBlobAccess(String containerName, String blobName) { Map<String, BlobAccess> map = containerToBlobAccess.get(containerName); if (map == null) { throw new ContainerNotFoundException(containerName, "in getBlobAccess"); } BlobAccess access = map.get(blobName); if (access == null) { throw new KeyNotFoundException(containerName, blobName, "in getBlobAccess"); } return access; }
@Override public void setBlobAccess(String containerName, String blobName, BlobAccess access) { Map<String, BlobAccess> map = containerToBlobAccess.get(containerName); if (map == null) { throw new ContainerNotFoundException(containerName, "in setBlobAccess"); } map.put(blobName, access); }
System.exit(Errno.EACCES.getErrno()); } catch (ContainerNotFoundException cnfe) { System.err.println("Container not found: " + cnfe.getMessage()); System.exit(Errno.ENOENT.getErrno()); } catch (FileNotFoundException fnfe) { System.exit(Errno.EIO.getErrno()); } catch (KeyNotFoundException knfe) { System.err.println("Blob not found: " + knfe.getMessage()); System.exit(Errno.ENOENT.getErrno()); } catch (Throwable t) {
log.warn("Failed to load seed nodes list [container={}, cluster={}, cause={}]", container, cluster, e.toString());
@Override public void setBlobAccess(String containerName, String blobName, BlobAccess access) { Map<String, BlobAccess> map = containerToBlobAccess.get(containerName); if (map == null) { throw new ContainerNotFoundException(containerName, "in setBlobAccess"); } map.put(blobName, access); }
@Override public BlobAccess getBlobAccess(String containerName, String blobName) { Map<String, BlobAccess> map = containerToBlobAccess.get(containerName); if (map == null) { throw new ContainerNotFoundException(containerName, "in getBlobAccess"); } BlobAccess access = map.get(blobName); if (access == null) { throw new KeyNotFoundException(containerName, blobName, "in getBlobAccess"); } return access; }
@Override public void setBlobAccess(String containerName, String blobName, BlobAccess access) { Map<String, BlobAccess> map = containerToBlobAccess.get(containerName); if (map == null) { throw new ContainerNotFoundException(containerName, "in setBlobAccess"); } map.put(blobName, access); }
@Override public BlobAccess getBlobAccess(String containerName, String blobName) { Map<String, BlobAccess> map = containerToBlobAccess.get(containerName); if (map == null) { throw new ContainerNotFoundException(containerName, "in getBlobAccess"); } BlobAccess access = map.get(blobName); if (access == null) { throw new KeyNotFoundException(containerName, blobName, "in getBlobAccess"); } return access; }
@Override public void setBlobAccess(String containerName, String blobName, BlobAccess access) { Map<String, BlobAccess> map = containerToBlobAccess.get(containerName); if (map == null) { throw new ContainerNotFoundException(containerName, "in setBlobAccess"); } map.put(blobName, access); }
@Override public BlobAccess getBlobAccess(String containerName, String blobName) { Map<String, BlobAccess> map = containerToBlobAccess.get(containerName); if (map == null) { throw new ContainerNotFoundException(containerName, "in getBlobAccess"); } BlobAccess access = map.get(blobName); if (access == null) { throw new KeyNotFoundException(containerName, blobName, "in getBlobAccess"); } return access; }
public Object createOrPropagate(Throwable t) throws Exception { if (contains404(checkNotNull(t, "throwable"))) throw new ContainerNotFoundException(t); throw propagate(t); } }
protected Exception refineException(HttpCommand command, HttpResponse response, Exception exception, AzureStorageError error, String message) { switch (response.getStatusCode()) { case 404: if (!command.getCurrentRequest().getMethod().equals("DELETE")) { exception = new ResourceNotFoundException(message, exception); List<String> parts = Lists.newArrayList(Splitter.on('/').split( command.getCurrentRequest().getEndpoint().getPath())); 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); } } } return exception; default: return super.refineException(command, response, exception, error, message); } } }
public Object createOrPropagate(Throwable t) throws Exception { if (contains404(checkNotNull(t, "throwable"))) throw new ContainerNotFoundException(t); throw propagate(t); } }
protected Exception refineException(HttpCommand command, HttpResponse response, Exception exception, AzureStorageError error, String message) { switch (response.getStatusCode()) { case 404: if (!command.getCurrentRequest().getMethod().equals("DELETE")) { exception = new ResourceNotFoundException(message, exception); List<String> parts = Lists.newArrayList(Splitter.on('/').split( command.getCurrentRequest().getEndpoint().getPath())); 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); } } } return exception; default: return super.refineException(command, response, exception, error, message); } } }
public Object createOrPropagate(Throwable t) throws Exception { if (contains404(checkNotNull(t, "throwable"))) throw new ContainerNotFoundException(t); throw propagate(t); }
private static Exception refineException(B2Error error, Exception exception) { if ("bad_bucket_id".equals(error.code())) { return new ContainerNotFoundException(exception); } else if ("bad_json".equals(error.code())) { return new IllegalArgumentException(error.message(), exception); } else if ("bad_request".equals(error.code())) { return new IllegalArgumentException(error.message(), exception); } else if ("file_not_present".equals(error.code())) { return new KeyNotFoundException(exception); } else if ("not_found".equals(error.code())) { return new ResourceNotFoundException(error.message(), exception); } else { return exception; } }
private ContainerNotFoundException cnfe(final String name) { return new ContainerNotFoundException(name, String.format( "container %s not in %s", name, storageStrategy.getAllContainerNames())); }
protected Exception refineException(HttpCommand command, HttpResponse response, Exception exception, AzureStorageError error, String message) { switch (response.getStatusCode()) { case 404: if (!command.getCurrentRequest().getMethod().equals("DELETE")) { exception = new ResourceNotFoundException(message, exception); List<String> parts = Lists.newArrayList(Splitter.on('/').split( command.getCurrentRequest().getEndpoint().getPath())); 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); } } } return exception; default: return super.refineException(command, response, exception, error, message); } } }
private ContainerNotFoundException cnfe(final String name) { return new ContainerNotFoundException(name, String.format( "container %s not in %s", name, storageStrategy.getAllContainerNames())); }
@Override public BlobAccess getBlobAccess(String containerName, String blobName) { if (!new File(buildPathStartingFromBaseDir(containerName)).exists()) { throw new ContainerNotFoundException(containerName, "in getBlobAccess"); throw new KeyNotFoundException(containerName, blobName, "in getBlobAccess");