@Override protected StorageBucket[] listAllBucketsImpl(Map<String, Object> headers) throws ServiceException { if(log.isDebugEnabled()) { log.debug("Listing all buckets for user: " + getProviderCredentials().getAccessKey()); } String bucketName = ""; // Root path of S3 service lists the user's buckets. HttpResponse httpResponse = performRestGet(bucketName, null, null, headers); String contentType = httpResponse.getFirstHeader("Content-Type").getValue(); if(!isXmlContentType(contentType)) { throw new ServiceException("Expected XML document response from S3 but received content type " + contentType); } return getXmlResponseSaxParser() .parseListMyBucketsResponse( new HttpMethodReleaseInputStream(httpResponse)).getBuckets(); }
@Override protected StorageOwner getAccountOwnerImpl() throws ServiceException { if(log.isDebugEnabled()) { log.debug("Looking up owner of S3 account via the ListAllBuckets response: " + getProviderCredentials().getAccessKey()); } String bucketName = ""; // Root path of S3 service lists the user's buckets. HttpResponse httpResponse = performRestGet(bucketName, null, null, null); String contentType = httpResponse.getFirstHeader("Content-Type").getValue(); if(!isXmlContentType(contentType)) { throw new ServiceException("Expected XML document response from S3 but received content type " + contentType); } return getXmlResponseSaxParser() .parseListMyBucketsResponse( new HttpMethodReleaseInputStream(httpResponse)).getOwner(); }
@Override protected StorageOwner getAccountOwnerImpl() throws ServiceException { if(log.isDebugEnabled()) { log.debug("Looking up owner of S3 account via the ListAllBuckets response: " + getProviderCredentials().getAccessKey()); } String bucketName = ""; // Root path of S3 service lists the user's buckets. HttpResponse httpResponse = performRestGet(bucketName, null, null, null); String contentType = httpResponse.getFirstHeader("Content-Type").getValue(); if(!isXmlContentType(contentType)) { throw new ServiceException("Expected XML document response from S3 but received content type " + contentType); } return getXmlResponseSaxParser() .parseListMyBucketsResponse( new HttpMethodReleaseInputStream(httpResponse)).getOwner(); }
@Override protected StorageBucket[] listAllBucketsImpl(Map<String, Object> headers) throws ServiceException { if(log.isDebugEnabled()) { log.debug("Listing all buckets for user: " + getProviderCredentials().getAccessKey()); } String bucketName = ""; // Root path of S3 service lists the user's buckets. HttpResponse httpResponse = performRestGet(bucketName, null, null, headers); String contentType = httpResponse.getFirstHeader("Content-Type").getValue(); if(!isXmlContentType(contentType)) { throw new ServiceException("Expected XML document response from S3 but received content type " + contentType); } return getXmlResponseSaxParser() .parseListMyBucketsResponse( new HttpMethodReleaseInputStream(httpResponse)).getBuckets(); }