Codota Logo
KeyNotFoundException.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.jclouds.blobstore.KeyNotFoundException
constructor

Best Java code snippets using org.jclouds.blobstore.KeyNotFoundException.<init> (Showing top 20 results out of 315)

  • Common ways to obtain KeyNotFoundException
private void myMethod () {
KeyNotFoundException k =
  • Codota IconString container;String key;String str;new KeyNotFoundException(container, key, str)
  • Codota IconThrowable from;new KeyNotFoundException(from)
  • Codota IconMatcher matcher;String message;new KeyNotFoundException(matcher.group(1), matcher.group(2), message)
  • Smart code suggestions by Codota
}
origin: stackoverflow.com

 public static String getKey(String key) throws KeyNotFoundException {
  String value = getOptionalKey(key);
  if (value.equals("")) throw new KeyNotFoundException(key);
  return value;
}

public static String getOptionalKey(String key) {
  if (key.equals("something")) {
    return "great";
  } else {
    return "";
  }
}
origin: stackoverflow.com

 public static String getKey(String key) throws KeyNotFoundException {
  return getOptionalKey(key).orElseThrow(() -> new KeyNotFoundException(key));
}
origin: stackoverflow.com

 class final ResultHoder {
 String result;
 public void setResult(String result) {
  this.result = result;
 }
 public String getResult() {
  return this.result;
 }
}


public static void getKey(String key, ResultHolder result) throws KeyNotFoundException {
  if (key.equals("something")) {
    result.setResult("great");
    return;
  } else {
    result.setResult("");
    throw new KeyNotFoundException();
  }
}
origin: org.jclouds/jclouds-blobstore

public Object createOrPropagate(Throwable t) throws Exception {
  if (contains404(checkNotNull(t, "throwable")))
   throw new KeyNotFoundException(t);
  throw propagate(t);
}
origin: jclouds/legacy-jclouds

public Object createOrPropagate(Throwable t) throws Exception {
  if (contains404(checkNotNull(t, "throwable")))
   throw new KeyNotFoundException(t);
  throw propagate(t);
}
origin: org.apache.jclouds/jclouds-blobstore

 public Object createOrPropagate(Throwable t) throws Exception {
   if (contains404(checkNotNull(t, "throwable")))
    throw new KeyNotFoundException(t);
   throw propagate(t);
 }
}
origin: org.apache.jclouds/jclouds-blobstore

@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;
}
origin: com.amysta.jclouds/jclouds-blobstore

@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;
}
origin: Nextdoor/bender

@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;
}
origin: Nextdoor/bender

 public Object createOrPropagate(Throwable t) throws Exception {
   if (contains404(checkNotNull(t, "throwable")))
    throw new KeyNotFoundException(t);
   throw propagate(t);
 }
}
origin: io.cloudsoft.jclouds/jclouds-blobstore

public Object createOrPropagate(Throwable t) throws Exception {
  if (contains404(checkNotNull(t, "throwable")))
   throw new KeyNotFoundException(t);
  throw propagate(t);
}
origin: com.amysta.jclouds/jclouds-blobstore

 public Object createOrPropagate(Throwable t) throws Exception {
   if (contains404(checkNotNull(t, "throwable")))
    throw new KeyNotFoundException(t);
   throw propagate(t);
 }
}
origin: apache/jclouds

@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;
}
origin: apache/jclouds

 public Object createOrPropagate(Throwable t) throws Exception {
   if (contains404(checkNotNull(t, "throwable")))
    throw new KeyNotFoundException(t);
   throw propagate(t);
 }
}
origin: org.apache.jclouds.karaf/commands

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

   if (!blobStore.blobExists(containerName, blobName)) {
     throw new KeyNotFoundException(containerName, blobName, "while checking existence");
   }
   return null;
  }
}
origin: Nextdoor/bender

  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);
   }
  }
}
origin: apache/jclouds

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;
 }
}
origin: org.apache.jclouds.provider/b2

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;
 }
}
origin: org.apache.jclouds.labs/b2

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;
 }
}
origin: Nextdoor/bender

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;
 }
}
org.jclouds.blobstoreKeyNotFoundException<init>

Popular methods of KeyNotFoundException

  • getMessage

Popular in Java

  • Reactive rest calls using spring rest template
  • addToBackStack (FragmentTransaction)
  • runOnUiThread (Activity)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • Collectors (java.util.stream)
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JOptionPane (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now