org.jets3t.service.impl.rest.httpclient
Class GoogleStorageService

java.lang.Object
  extended by org.jets3t.service.StorageService
      extended by org.jets3t.service.impl.rest.httpclient.RestStorageService
          extended by org.jets3t.service.impl.rest.httpclient.GoogleStorageService
All Implemented Interfaces:
JetS3tRequestAuthorizer

public class GoogleStorageService
extends RestStorageService

REST/HTTP implementation of Google Storage Service based on the HttpClient library.

This class uses properties obtained through Jets3tProperties. For more information on these properties please refer to JetS3t Configuration


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jets3t.service.impl.rest.httpclient.RestStorageService
RestStorageService.HTTP_METHOD
 
Field Summary
 
Fields inherited from class org.jets3t.service.impl.rest.httpclient.RestStorageService
credentialsProvider, defaultServerSideEncryptionAlgorithm, defaultStorageClass, httpClient, shuttingDown
 
Fields inherited from class org.jets3t.service.StorageService
BUCKET_STATUS__ALREADY_CLAIMED, BUCKET_STATUS__DOES_NOT_EXIST, BUCKET_STATUS__MY_BUCKET, timeOffset
 
Constructor Summary
GoogleStorageService(ProviderCredentials credentials)
          Constructs the service and initialises the properties.
GoogleStorageService(ProviderCredentials credentials, java.lang.String invokingApplicationDescription, org.apache.http.client.CredentialsProvider credentialsProvider)
          Constructs the service and initialises the properties.
GoogleStorageService(ProviderCredentials credentials, java.lang.String invokingApplicationDescription, org.apache.http.client.CredentialsProvider credentialsProvider, Jets3tProperties jets3tProperties)
          Constructs the service and initialises the properties.
 
Method Summary
 void authorizeHttpRequest(org.apache.http.client.methods.HttpUriRequest httpMethod, org.apache.http.protocol.HttpContext context)
          Authorizes an HTTP/S request using the standard HMAC approach or OAuth 2, whichever technique is appropriate.
 GSBucket createBucket(java.lang.String bucketName)
          Creates a bucket.
 GSBucket createBucket(java.lang.String bucketName, java.lang.String location, AccessControlList acl)
           
 GSBucket createBucket(java.lang.String bucketName, java.lang.String location, AccessControlList acl, java.lang.String projectId)
          Creates a bucket in a specific location, without checking whether the bucket already exists.
protected  StorageBucket createBucketImpl(java.lang.String bucketName, java.lang.String location, AccessControlList acl, java.lang.String projectId)
           
 void deleteWebsiteConfig(java.lang.String bucketName)
          Delete a bucket's website configuration; removes the effect of any previously-applied configuration.
protected  void deleteWebsiteConfigImpl(java.lang.String bucketName)
           
 GSAccessControlList getBucketAcl(java.lang.String bucketName)
          Retrieves the access control settings of a bucket.
 java.lang.String getBucketLocation(java.lang.String bucketName)
           
 GSBucketLoggingStatus getBucketLoggingStatus(java.lang.String bucketName)
           
protected  boolean getDisableDnsBuckets()
           
protected  boolean getEnableServerSideEncryption()
           
protected  boolean getEnableStorageClasses()
           
 java.lang.String getEndpoint()
           
protected  int getHttpPort()
           
protected  boolean getHttpsOnly()
           
protected  int getHttpsPort()
           
 GSObject getObject(java.lang.String bucketName, java.lang.String objectKey)
          Returns an object representing the details and data of an item in a service, without applying any preconditions.
 GSObject getObject(java.lang.String bucketName, java.lang.String objectKey, java.util.Calendar ifModifiedSince, java.util.Calendar ifUnmodifiedSince, java.lang.String[] ifMatchTags, java.lang.String[] ifNoneMatchTags, java.lang.Long byteRangeStart, java.lang.Long byteRangeEnd)
          Returns an object representing the details and data of an item that meets any given preconditions.
 GSObject getObjectDetails(java.lang.String bucketName, java.lang.String objectKey)
          Returns an object representing the details of an item in without the object's data, and without applying any preconditions.
 java.util.List<java.lang.String> getResourceParameterNames()
           
 java.lang.String getRestHeaderPrefix()
           
 java.lang.String getRestMetadataPrefix()
           
protected  java.lang.String getSignatureIdentifier()
           
protected  java.lang.String getVirtualPath()
           
 GSWebsiteConfig getWebsiteConfig(java.lang.String bucketName)
           
protected  XmlResponsesSaxParser getXmlResponseSaxParser()
           
protected  boolean isRecoverable403(org.apache.http.client.methods.HttpUriRequest httpRequest, java.lang.Exception exception)
          Determine whether a given 403 Forbidden HTTP error response is recoverable and should be retried.
protected  boolean isTargettingGoogleStorageService()
           
 GSBucket[] listAllBuckets()
          Lists the buckets belonging to the service user.
 GSBucket[] listAllBuckets(java.lang.String projectId)
          List all buckets in a given project
protected  StorageBucket[] listAllBucketsImpl(java.lang.String projectId)
           
 GSObject[] listObjects(java.lang.String bucketName)
          Lists the objects in a bucket.
 GSObject[] listObjects(java.lang.String bucketName, java.lang.String prefix, java.lang.String delimiter)
          Lists the objects in a bucket matching a prefix and delimiter.
protected  StorageBucket newBucket()
           
protected  StorageObject newObject()
           
 void putBucketAcl(GSBucket bucket)
          Applies access control settings to a bucket.
 void putBucketAcl(java.lang.String bucketName, GSAccessControlList acl)
          Applies access control settings to a bucket.
 GSObject putObject(java.lang.String bucketName, GSObject object)
           
 void setBucketLoggingStatus(java.lang.String bucketName, GSBucketLoggingStatus status)
           
protected  org.apache.http.client.methods.HttpUriRequest setupConnection(RestStorageService.HTTP_METHOD method, java.lang.String bucketName, java.lang.String objectKey, java.util.Map<java.lang.String,java.lang.String> requestParameters)
          Creates an HttpRequest object to handle a particular connection method.
 void setWebsiteConfig(java.lang.String bucketName, GSWebsiteConfig config)
          Apply a website configuration to a bucket.
 
Methods inherited from class org.jets3t.service.impl.rest.httpclient.RestStorageService
addMetadataToHeaders, addRequestHeadersToConnection, addRequestParametersToUrlPath, checkBucketStatus, copyObjectImpl, createBucketImpl, createObjectImpl, deleteBucketImpl, deleteObjectImpl, deleteObjectWithSignedUrl, getAccountOwnerImpl, getBucketAclImpl, getBucketLocationImpl, getBucketLoggingStatusImpl, getCredentialsProvider, getHttpClient, getHttpConnectionManager, getObjectAclImpl, getObjectAclImpl, getObjectAclWithSignedUrl, getObjectDetailsImpl, getObjectDetailsWithSignedUrl, getObjectImpl, getObjectWithSignedUrl, getWebsiteConfigImpl, initHttpConnection, initializeDefaults, initializeProxy, isBucketAccessible, isLiveMD5HashingRequired, isXmlContentType, listAllBucketsImpl, listObjectsChunkedImpl, listObjectsImpl, listObjectsInternal, performRequest, performRequest, performRestDelete, performRestGet, performRestGet, performRestHead, performRestPost, performRestPostWithXmlBuilder, performRestPut, performRestPutWithXmlBuilder, prepareRESTHeaderAcl, prepareServerSideEncryption, prepareStorageClass, putAclImpl, putBucketAclImpl, putObjectAclImpl, putObjectAclWithSignedUrl, putObjectImpl, putObjectWithRequestEntityImpl, putObjectWithSignedUrl, setBucketLoggingStatusImpl, setCredentialsProvider, setHttpClient, setWebsiteConfigImpl, shutdownImpl, verifyExpectedAndActualETagValues
 
Methods inherited from class org.jets3t.service.StorageService
assertAuthenticatedConnection, assertValidBucket, assertValidObject, assertValidObject, copyObject, copyObject, createBucket, createBucketImpl, deleteBucket, deleteBucket, deleteObject, getAccountOwner, getBucket, getCurrentTimeWithOffset, getInternalErrorRetryMax, getInvokingApplicationDescription, getJetS3tProperties, getObjectAcl, getObjectDetails, getOrCreateBucket, getProviderCredentials, isAuthenticatedConnection, isHttpsOnly, isObjectInBucket, isShutdown, listAllBucketsImpl, listObjects, listObjectsChunked, listObjectsChunked, moveObject, putBucketAcl, putBucketAcl, putObject, putObjectAcl, putObjectAcl, renameMetadataKeys, renameObject, setProviderCredentials, shutdown, sleepOnInternalError, updateObjectMetadata
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GoogleStorageService

public GoogleStorageService(ProviderCredentials credentials)
                     throws ServiceException
Constructs the service and initialises the properties.

Parameters:
credentials - the user credentials to use when communicating with Google Storage, may be null in which case the communication is done as an anonymous user.
Throws:
ServiceException - Service error

GoogleStorageService

public GoogleStorageService(ProviderCredentials credentials,
                            java.lang.String invokingApplicationDescription,
                            org.apache.http.client.CredentialsProvider credentialsProvider)
                     throws ServiceException
Constructs the service and initialises the properties.

Parameters:
credentials - the user credentials to use when communicating with Google Storage, may be null in which case the communication is done as an anonymous user.
invokingApplicationDescription - a short description of the application using the service, suitable for inclusion in a user agent string for REST/HTTP requests. Ideally this would include the application's version number, for example: Cockpit/0.7.3 or My App Name/1.0
credentialsProvider - an implementation of the HttpClient CredentialsProvider interface, to provide a means for prompting for credentials when necessary.
Throws:
ServiceException - Service error

GoogleStorageService

public GoogleStorageService(ProviderCredentials credentials,
                            java.lang.String invokingApplicationDescription,
                            org.apache.http.client.CredentialsProvider credentialsProvider,
                            Jets3tProperties jets3tProperties)
                     throws ServiceException
Constructs the service and initialises the properties.

Parameters:
credentials - the user credentials to use when communicating with Google Storage, may be null in which case the communication is done as an anonymous user.
invokingApplicationDescription - a short description of the application using the service, suitable for inclusion in a user agent string for REST/HTTP requests. Ideally this would include the application's version number, for example: Cockpit/0.7.3 or My App Name/1.0
credentialsProvider - an implementation of the HttpClient CredentialsProvider interface, to provide a means for prompting for credentials when necessary.
jets3tProperties - JetS3t properties that will be applied within this service.
Throws:
ServiceException - Service error
Method Detail

setupConnection

protected org.apache.http.client.methods.HttpUriRequest setupConnection(RestStorageService.HTTP_METHOD method,
                                                                        java.lang.String bucketName,
                                                                        java.lang.String objectKey,
                                                                        java.util.Map<java.lang.String,java.lang.String> requestParameters)
                                                                 throws ServiceException
Description copied from class: RestStorageService
Creates an HttpRequest object to handle a particular connection method.

Overrides:
setupConnection in class RestStorageService
Parameters:
method - the HTTP method/connection-type to use, must be one of: PUT, HEAD, GET, DELETE
bucketName - the bucket's name
objectKey - the object's key name, may be null if the operation is on a bucket only.
Returns:
the HTTP method object used to perform the request
Throws:
ServiceException

isTargettingGoogleStorageService

protected boolean isTargettingGoogleStorageService()
Specified by:
isTargettingGoogleStorageService in class RestStorageService

getEndpoint

public java.lang.String getEndpoint()
Specified by:
getEndpoint in class StorageService
Returns:
the endpoint to be used to connect to Google Storage.

getVirtualPath

protected java.lang.String getVirtualPath()
Specified by:
getVirtualPath in class StorageService
Returns:
the virtual path inside the service.

getSignatureIdentifier

protected java.lang.String getSignatureIdentifier()
Specified by:
getSignatureIdentifier in class StorageService
Returns:
the identifier for the signature algorithm.

getRestHeaderPrefix

public java.lang.String getRestHeaderPrefix()
Specified by:
getRestHeaderPrefix in class StorageService
Returns:
header prefix for general Google Storage headers: x-goog-.

getRestMetadataPrefix

public java.lang.String getRestMetadataPrefix()
Specified by:
getRestMetadataPrefix in class StorageService
Returns:
header prefix for Google Storage metadata headers: x-goog-meta-.

getResourceParameterNames

public java.util.List<java.lang.String> getResourceParameterNames()
Specified by:
getResourceParameterNames in class StorageService
Returns:
GET parameter names that represent specific resources in the target service, as opposed to representing REST operation "plumbing". For example the "acl" parameter might be used to represent a resource's access control list settings.

getHttpPort

protected int getHttpPort()
Specified by:
getHttpPort in class StorageService
Returns:
the port number to be used for insecure connections over HTTP.

getHttpsPort

protected int getHttpsPort()
Specified by:
getHttpsPort in class StorageService
Returns:
the port number to be used for secure connections over HTTPS.

getHttpsOnly

protected boolean getHttpsOnly()
Specified by:
getHttpsOnly in class StorageService
Returns:
If true, all communication with GS will be via encrypted HTTPS connections, otherwise communications will be sent unencrypted via HTTP

getDisableDnsBuckets

protected boolean getDisableDnsBuckets()
Specified by:
getDisableDnsBuckets in class StorageService
Returns:
If true, JetS3t will specify bucket names in the request path of the HTTP message instead of the Host header.

getEnableStorageClasses

protected boolean getEnableStorageClasses()
Specified by:
getEnableStorageClasses in class StorageService
Returns:
False, since Google Storage does not support storage classes.

getEnableServerSideEncryption

protected boolean getEnableServerSideEncryption()
Specified by:
getEnableServerSideEncryption in class StorageService
Returns:
False, since Google Storage does not support server-side encryption.

getXmlResponseSaxParser

protected XmlResponsesSaxParser getXmlResponseSaxParser()
                                                 throws ServiceException
Specified by:
getXmlResponseSaxParser in class StorageService
Returns:
an XML SAX Parser capable of parsing responses from the implemented storage service.
Throws:
ServiceException

newBucket

protected StorageBucket newBucket()
Specified by:
newBucket in class StorageService
Returns:
a service-specific {#link StorageBucket implementation.

newObject

protected StorageObject newObject()
Specified by:
newObject in class StorageService
Returns:
a service-specific {#link StorageObject implementation.

listAllBuckets

public GSBucket[] listAllBuckets()
                          throws ServiceException
Description copied from class: StorageService
Lists the buckets belonging to the service user.

This method cannot be performed by anonymous services, and will fail with an exception if the service is not authenticated.

Overrides:
listAllBuckets in class StorageService
Returns:
the list of buckets owned by the service user.
Throws:
ServiceException

listAllBuckets

public GSBucket[] listAllBuckets(java.lang.String projectId)
                          throws ServiceException
List all buckets in a given project

Parameters:
projectId - The ID of the project being listed
Returns:
a list of GSBucket
Throws:
ServiceException - Service error

listObjects

public GSObject[] listObjects(java.lang.String bucketName)
                       throws ServiceException
Description copied from class: StorageService
Lists the objects in a bucket.

The objects returned by this method contain only minimal information such as the object's size, ETag, and LastModified timestamp. To retrieve the objects' metadata you must perform follow-up getObject or getObjectDetails operations.

This method can be performed by anonymous services. Anonymous services can only list the objects in a publicly-readable bucket.

Overrides:
listObjects in class StorageService
Parameters:
bucketName - the name of the bucket whose contents will be listed.
Returns:
the set of objects contained in a bucket.
Throws:
ServiceException

listObjects

public GSObject[] listObjects(java.lang.String bucketName,
                              java.lang.String prefix,
                              java.lang.String delimiter)
                       throws ServiceException
Description copied from class: StorageService
Lists the objects in a bucket matching a prefix and delimiter.

The objects returned by this method contain only minimal information such as the object's size, ETag, and LastModified timestamp. To retrieve the objects' metadata you must perform follow-up getObject or getObjectDetails operations.

This method can be performed by anonymous services. Anonymous services can only list the objects in a publicly-readable bucket.

NOTE: If you supply a delimiter value that could cause virtual path "subdirectories" to be included in the results from the service, use the StorageService.listObjectsChunked(String, String, String, long, String, boolean) method instead of this one to obtain both object and path values.

Overrides:
listObjects in class StorageService
Parameters:
bucketName - the name of the bucket whose contents will be listed.
prefix - only objects with a key that starts with this prefix will be listed
delimiter - only list objects with key names up to this delimiter, may be null. See note above. Note: If a non-null delimiter is specified, the prefix must include enough text to reach the first occurrence of the delimiter in the bucket's keys, or no results will be returned.
Returns:
the set of objects contained in a bucket whose keys start with the given prefix.
Throws:
ServiceException

createBucket

public GSBucket createBucket(java.lang.String bucketName)
                      throws ServiceException
Description copied from class: StorageService
Creates a bucket. Caution: Performing this operation unnecessarily when a bucket already exists may cause OperationAborted errors with the message "A conflicting conditional operation is currently in progress against this resource.". To avoid this error, use the StorageService.getOrCreateBucket(String) in situations where the bucket may already exist. This method cannot be performed by anonymous services.

Overrides:
createBucket in class StorageService
Parameters:
bucketName - the name of the bucket to create.
Returns:
the created bucket object. Note: the object returned has minimal information about the bucket that was created, including only the bucket's name.
Throws:
ServiceException

createBucket

public GSBucket createBucket(java.lang.String bucketName,
                             java.lang.String location,
                             AccessControlList acl,
                             java.lang.String projectId)
                      throws ServiceException
Creates a bucket in a specific location, without checking whether the bucket already exists. Caution: Performing this operation unnecessarily when a bucket already exists may cause OperationAborted errors with the message "A conflicting conditional operation is currently in progress against this resource.". To avoid this error, use the StorageService.getOrCreateBucket(String) in situations where the bucket may already exist.

This method cannot be performed by anonymous services.

Parameters:
bucketName - the name of the bucket to create.
location - the location of the S3 data centre in which the bucket will be created, or null for the default GSBucket.LOCATION_US location. Valid values include GSBucket.LOCATION_US, GSBucket.LOCATION_EUROPE, and the default US location that can be expressed in two ways: GSBucket.LOCATION_US or GSBucket.LOCATION_DEFAULT.
acl - the access control settings to apply to the new bucket, or null for default ACL values.
projectId - the project within which to create the bucket
Returns:
the created bucket object. Note: the object returned has minimal information about the bucket that was created, including only the bucket's name.
Throws:
ServiceException - Service error

createBucket

public GSBucket createBucket(java.lang.String bucketName,
                             java.lang.String location,
                             AccessControlList acl)
                      throws ServiceException
Throws:
ServiceException

getBucketLoggingStatus

public GSBucketLoggingStatus getBucketLoggingStatus(java.lang.String bucketName)
                                             throws ServiceException
Throws:
ServiceException

setBucketLoggingStatus

public void setBucketLoggingStatus(java.lang.String bucketName,
                                   GSBucketLoggingStatus status)
                            throws ServiceException
Throws:
ServiceException

getBucketLocation

public java.lang.String getBucketLocation(java.lang.String bucketName)
                                   throws ServiceException
Throws:
ServiceException

getBucketAcl

public GSAccessControlList getBucketAcl(java.lang.String bucketName)
                                 throws ServiceException
Description copied from class: StorageService
Retrieves the access control settings of a bucket. This method can be performed by anonymous services, but can only succeed if the bucket's existing ACL already allows write access by the anonymous user. In general, you can only access the ACL of a bucket if the ACL already in place for that bucket allows you to do so.

Overrides:
getBucketAcl in class StorageService
Parameters:
bucketName - the name of the bucket whose access control settings will be returned.
Returns:
the ACL settings of the bucket.
Throws:
ServiceException

putBucketAcl

public void putBucketAcl(java.lang.String bucketName,
                         GSAccessControlList acl)
                  throws ServiceException
Applies access control settings to a bucket. The ACL settings must be included inside the bucket. This method can be performed by anonymous services, but can only succeed if the bucket's existing ACL already allows write access by the anonymous user.

Parameters:
bucketName - a name of the bucket with ACL settings to apply.
acl - Permissions
Throws:
ServiceException - Service error

putBucketAcl

public void putBucketAcl(GSBucket bucket)
                  throws ServiceException
Applies access control settings to a bucket. The ACL settings must be included inside the bucket. This method can be performed by anonymous services, but can only succeed if the bucket's existing ACL already allows write access by the anonymous user.

Parameters:
bucket - a bucket with ACL settings to apply.
Throws:
ServiceException - Service error

getObject

public GSObject getObject(java.lang.String bucketName,
                          java.lang.String objectKey)
                   throws ServiceException
Description copied from class: StorageService
Returns an object representing the details and data of an item in a service, without applying any preconditions.

This method can be performed by anonymous services. Anonymous services can get a publicly-readable object.

Important: It is the caller's responsibility to close the object's data input stream. The data stream should be consumed and closed as soon as is practical as network connections may be held open until the streams are closed. Excessive unclosed streams can lead to connection starvation.

Overrides:
getObject in class StorageService
Parameters:
bucketName - the name of the bucket containing the object.
objectKey - the key identifying the object.
Returns:
the object with the given key, including the object's data input stream.
Throws:
ServiceException

putObject

public GSObject putObject(java.lang.String bucketName,
                          GSObject object)
                   throws ServiceException
Throws:
ServiceException

getObject

public GSObject getObject(java.lang.String bucketName,
                          java.lang.String objectKey,
                          java.util.Calendar ifModifiedSince,
                          java.util.Calendar ifUnmodifiedSince,
                          java.lang.String[] ifMatchTags,
                          java.lang.String[] ifNoneMatchTags,
                          java.lang.Long byteRangeStart,
                          java.lang.Long byteRangeEnd)
                   throws ServiceException
Description copied from class: StorageService
Returns an object representing the details and data of an item that meets any given preconditions.

Important: It is the caller's responsibility to close the object's data input stream. The data stream should be consumed and closed as soon as is practical as network connections may be held open until the streams are closed. Excessive unclosed streams can lead to connection starvation.

An exception is thrown if any of the preconditions fail. Preconditions are only applied if they are non-null.

This method can be performed by anonymous services. Anonymous services can get a publicly-readable object.

Implementation notes

Implementations should use StorageService.assertValidBucket(org.jets3t.service.model.StorageBucket, java.lang.String) assertion.

Overrides:
getObject in class StorageService
Parameters:
bucketName - the name of the bucket containing the object.
objectKey - the key identifying the object.
ifModifiedSince - a precondition specifying a date after which the object must have been modified, ignored if null.
ifUnmodifiedSince - a precondition specifying a date after which the object must not have been modified, ignored if null.
ifMatchTags - a precondition specifying an MD5 hash the object must match, ignored if null.
ifNoneMatchTags - a precondition specifying an MD5 hash the object must not match, ignored if null.
byteRangeStart - include only a portion of the object's data - starting at this point, ignored if null.
byteRangeEnd - include only a portion of the object's data - ending at this point, ignored if null.
Returns:
the object with the given key, including only general details and metadata (not the data input stream)
Throws:
ServiceException

getObjectDetails

public GSObject getObjectDetails(java.lang.String bucketName,
                                 java.lang.String objectKey)
                          throws ServiceException
Description copied from class: StorageService
Returns an object representing the details of an item in without the object's data, and without applying any preconditions.

This method can be performed by anonymous services. Anonymous services can get a publicly-readable object's details.

Overrides:
getObjectDetails in class StorageService
Parameters:
bucketName - the name of the bucket containing the object.
objectKey - the key identifying the object.
Returns:
the object with the given key, including only general details and metadata (not the data input stream)
Throws:
ServiceException

authorizeHttpRequest

public void authorizeHttpRequest(org.apache.http.client.methods.HttpUriRequest httpMethod,
                                 org.apache.http.protocol.HttpContext context)
                          throws ServiceException
Authorizes an HTTP/S request using the standard HMAC approach or OAuth 2, whichever technique is appropriate.

Specified by:
authorizeHttpRequest in interface JetS3tRequestAuthorizer
Overrides:
authorizeHttpRequest in class RestStorageService
Parameters:
httpMethod - the request object
Throws:
ServiceException

isRecoverable403

protected boolean isRecoverable403(org.apache.http.client.methods.HttpUriRequest httpRequest,
                                   java.lang.Exception exception)
Description copied from class: RestStorageService
Determine whether a given 403 Forbidden HTTP error response is recoverable and should be retried. Normally 403s should only be retried if we can take some action as a side effect which makes the subsequent request likely to succeed.

Generally, such errors should not be retried since a user's access permissions for an item are unlikely to change, but if a service is using expiring authorization tokens (e.g. OAuth) it may be worthwhile retrying after refreshing those tokens.

Overrides:
isRecoverable403 in class RestStorageService
Parameters:
httpRequest - Request
exception - Server response
Returns:
true if the request should be retried, otherwise false.

listAllBucketsImpl

protected StorageBucket[] listAllBucketsImpl(java.lang.String projectId)
                                      throws ServiceException
Throws:
ServiceException

createBucketImpl

protected StorageBucket createBucketImpl(java.lang.String bucketName,
                                         java.lang.String location,
                                         AccessControlList acl,
                                         java.lang.String projectId)
                                  throws ServiceException
Throws:
ServiceException

setWebsiteConfig

public void setWebsiteConfig(java.lang.String bucketName,
                             GSWebsiteConfig config)
                      throws ServiceException
Apply a website configuration to a bucket.

Parameters:
bucketName - bucket to which the website configuration will be applied.
config - the website configuration details.
Throws:
ServiceException

getWebsiteConfig

public GSWebsiteConfig getWebsiteConfig(java.lang.String bucketName)
                                 throws ServiceException
Parameters:
bucketName - a bucket with a website configuration.
Returns:
the website configuration details.
Throws:
ServiceException

deleteWebsiteConfig

public void deleteWebsiteConfig(java.lang.String bucketName)
                         throws ServiceException
Delete a bucket's website configuration; removes the effect of any previously-applied configuration.

Parameters:
bucketName - a bucket with a website configuration.
Throws:
ServiceException

deleteWebsiteConfigImpl

protected void deleteWebsiteConfigImpl(java.lang.String bucketName)
                                throws ServiceException
Overrides:
deleteWebsiteConfigImpl in class RestStorageService
Throws:
ServiceException