protected static void handleAuthException(S3ServiceException e, FileURL fileURL) throws AuthException { int code = e.getResponseCode(); if(code==401 || code==403) throw new AuthException(fileURL); }
/** * 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; } } }
/** * 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; } } }
.append(s3se.getResponseCode()) .append("</td></tr>");
.append(s3se.getResponseCode()) .append("</td></tr>");
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));
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));