Tabnine Logo
S3ServiceException
Code IndexAdd Tabnine to your IDE (free)

How to use
S3ServiceException
in
org.jets3t.service

Best Java code snippets using org.jets3t.service.S3ServiceException (Showing top 20 results out of 315)

origin: org.jvnet.hudson.hadoop/hadoop-core

public InputStream retrieve(String key) throws IOException {
 try {
  S3Object object = s3Service.getObject(bucket, key);
  return object.getDataInputStream();
 } catch (S3ServiceException e) {
  if ("NoSuchKey".equals(e.getS3ErrorCode())) {
   return null;
  }
  if (e.getCause() instanceof IOException) {
   throw (IOException) e.getCause();
  }
  throw new S3Exception(e);
 }
}

origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t

@Override
protected String getBucketPolicyImpl(String bucketName)
  throws S3ServiceException
{
  try {
    Map<String, String> requestParameters = new HashMap<String, String>();
    requestParameters.put("policy", "");
    HttpResponse httpResponse = performRestGet(bucketName, null, requestParameters, null);
    return EntityUtils.toString(httpResponse.getEntity());
  } catch (ServiceException se) {
    throw new S3ServiceException(se);
  } catch (IOException  e) {
    throw new S3ServiceException(e);
  }
}
origin: mucommander/mucommander

protected static IOException getIOException(S3ServiceException e, FileURL fileURL) throws IOException {
  handleAuthException(e, fileURL);
  Throwable cause = e.getCause();
  if(cause instanceof IOException)
    return (IOException)cause;
  if(JavaVersion.JAVA_1_6.isCurrentOrHigher())
    return new IOException(e);
  return new IOException(e.getMessage());
}
origin: com.facebook.hadoop/hadoop-core

public void delete(String key) throws IOException {
 try {
  s3Service.deleteObject(bucket, key);
 } catch (S3ServiceException e) {
  if (e.getCause() instanceof IOException) {
   throw (IOException) e.getCause();
  }
  throw new S3Exception(e);
 }
}

origin: net.java.dev.jets3t/jets3t

if (s3se.getS3ErrorCode() != null) {
  detailsText.append("<tr><td><b>S3 Error Code</b></td><td>").append(s3se.getS3ErrorCode()).append("</td></tr>");
} else {
  String msg = throwable.getMessage();
if (s3se.getS3ErrorMessage() != null) {
  detailsText.append("<tr><td><b>S3 Message</b></td><td>")
    .append(s3se.getS3ErrorMessage()).append("</td></tr>");
  .append(s3se.getResponseCode())
  .append("</td></tr>");
if (s3se.getS3ErrorRequestId() != null) {
  detailsText.append("<tr><td><b>S3 Request Id</b></td><td>")
    .append(s3se.getS3ErrorRequestId()).append("</td></tr>");
if (s3se.getS3ErrorHostId() != null) {
  detailsText.append("<tr><td><b>S3 Host Id</b></td><td>")
    .append(s3se.getS3ErrorHostId()).append("</td></tr>");
Throwable cause = s3se.getCause();
while (cause != null && cause.getMessage() != null) {
  if (firstCause) {
origin: ch.cern.hadoop/hadoop-aws

LOG.debug(
  "S3ServiceException: {}: {} : {}",
  se.getS3ErrorCode(), se.getS3ErrorMessage(), se, se);
if ("InvalidRange".equals(se.getS3ErrorCode())) {
 result = new EOFException(FSExceptionMessages.CANNOT_SEEK_PAST_EOF);
} else {
origin: net.java.dev.jets3t/jets3t

  e.printStackTrace();
  s3Service.getObject(vBucketName, "versioned-object");
} catch (S3ServiceException e) {
  if (e.getResponseCode() == 404) {
    System.out.println("Is deleted object versioned? "
      + e.getResponseHeaders().get(Constants.AMZ_DELETE_MARKER));
    System.out.println("Delete marker version ID: "
      + e.getResponseHeaders().get(Constants.AMZ_VERSION_ID));
origin: com.facebook.hadoop/hadoop-core

private S3Object get(String key) {
 try {
  return s3Service.getObject(bucket, key);
 } catch (S3ServiceException e) {
  if ("NoSuchKey".equals(e.getS3ErrorCode())) {
   return null;
  }
 }
 return null;
}

origin: mucommander/mucommander

protected static void handleAuthException(S3ServiceException e, FileURL fileURL) throws AuthException {
  int code = e.getResponseCode();
  if(code==401 || code==403)
    throw new AuthException(fileURL);
}

origin: net.java.dev.jets3t/jets3t

/**
 * @return The service-specific Error Code returned by S3, if an S3 response is available.
 * For example "AccessDenied", "InternalError"
 * Null otherwise.
 */
public String getS3ErrorCode() {
  return this.getErrorCode();
}
origin: net.java.dev.jets3t/jets3t

/**
 * @return The Error Host ID returned by S3, if an S3 response is available.
 * Null otherwise.
 */
public String getS3ErrorHostId() {
  return this.getErrorHostId();
}
origin: net.java.dev.jets3t/jets3t

/**
 * @return The service-specific Error Message returned by S3, if an S3 response is available.
 * For example: "Access Denied", "We encountered an internal error. Please try again."
 */
public String getS3ErrorMessage() {
  return this.getErrorMessage();
}
origin: org.jvnet.hudson.hadoop/hadoop-core

private void delete(String key) throws IOException {
 try {
  s3Service.deleteObject(bucket, key);
 } catch (S3ServiceException e) {
  if (e.getCause() instanceof IOException) {
   throw (IOException) e.getCause();
  }
  throw new S3Exception(e);
 }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t

if (s3se.getS3ErrorCode() != null) {
  detailsText.append("<tr><td><b>S3 Error Code</b></td><td>").append(s3se.getS3ErrorCode()).append("</td></tr>");
} else {
  String msg = throwable.getMessage();
if (s3se.getS3ErrorMessage() != null) {
  detailsText.append("<tr><td><b>S3 Message</b></td><td>")
    .append(s3se.getS3ErrorMessage()).append("</td></tr>");
  .append(s3se.getResponseCode())
  .append("</td></tr>");
if (s3se.getS3ErrorRequestId() != null) {
  detailsText.append("<tr><td><b>S3 Request Id</b></td><td>")
    .append(s3se.getS3ErrorRequestId()).append("</td></tr>");
if (s3se.getS3ErrorHostId() != null) {
  detailsText.append("<tr><td><b>S3 Host Id</b></td><td>")
    .append(s3se.getS3ErrorHostId()).append("</td></tr>");
Throwable cause = s3se.getCause();
while (cause != null && cause.getMessage() != null) {
  if (firstCause) {
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t

  e.printStackTrace();
  s3Service.getObject(vBucketName, "versioned-object");
} catch (S3ServiceException e) {
  if (e.getResponseCode() == 404) {
    System.out.println("Is deleted object versioned? "
      + e.getResponseHeaders().get(Constants.AMZ_DELETE_MARKER));
    System.out.println("Delete marker version ID: "
      + e.getResponseHeaders().get(Constants.AMZ_VERSION_ID));
origin: org.jvnet.hudson.hadoop/hadoop-core

private S3Object get(String key) {
 try {
  return s3Service.getObject(bucket, key);
 } catch (S3ServiceException e) {
  if ("NoSuchKey".equals(e.getS3ErrorCode())) {
   return null;
  }
 }
 return null;
}

origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t

/**
 * Retrieve the JSON access control policy document for a bucket,
 * or null if the bucket does not have a policy.
 *
 * @param bucketName Name of the bucket
 * @return
 * JSON policy document for bucket, or null if the bucket has no policy.
 * @throws S3ServiceException
 */
public String getBucketPolicy(String bucketName)
  throws S3ServiceException
{
  try {
    return getBucketPolicyImpl(bucketName);
  } catch (S3ServiceException e) {
    if (e.getResponseCode() == 404) {
      return null;
    } else {
      throw e;
    }
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t

/**
 * @return The service-specific Error Code returned by S3, if an S3 response is available.
 * For example "AccessDenied", "InternalError"
 * Null otherwise.
 */
public String getS3ErrorCode() {
  return this.getErrorCode();
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t

/**
 * @return The Error Host ID returned by S3, if an S3 response is available.
 * Null otherwise.
 */
public String getS3ErrorHostId() {
  return this.getErrorHostId();
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t

/**
 * @return The service-specific Error Message returned by S3, if an S3 response is available.
 * For example: "Access Denied", "We encountered an internal error. Please try again."
 */
public String getS3ErrorMessage() {
  return this.getErrorMessage();
}
org.jets3t.serviceS3ServiceException

Javadoc

Exception for use by S3Services and related utilities. This exception can hold useful additional information about errors that occur when communicating with S3.

Most used methods

  • getCause
  • getS3ErrorCode
  • <init>
    Wrap a ServiceException as an S3ServiceException.
  • getMessage
  • getResponseCode
  • getS3ErrorMessage
  • getErrorCode
  • getErrorHostId
  • getErrorMessage
  • getErrorRequestId
  • getResponseHeaders
  • getS3ErrorHostId
  • getResponseHeaders,
  • getS3ErrorHostId,
  • getS3ErrorRequestId,
  • printStackTrace,
  • setRequestHost,
  • setRequestPath,
  • setRequestVerb,
  • setResponseCode,
  • setResponseDate,
  • setResponseHeaders

Popular in Java

  • Reading from database using SQL prepared statement
  • getSystemService (Context)
  • compareTo (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Notification (javax.management)
  • BoxLayout (javax.swing)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now