Class StorageClient
java.lang.Object
com.google.jenkins.plugins.storage.client.StorageClient
Client for communicating with the Google GCS API.
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionStorageClient(com.google.api.services.storage.Storage storage) Constructs a newStorageClientinstance.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddeleteBucket(String bucket) Delete bucket from GCS with name bucket.com.google.api.services.storage.Storage.Buckets.DeletedeleteBucketRequest(String bucket) Helper method to return the delete request.voiddeleteFromBucket(String bucket, String pattern) Delete object matching pattern from Google Cloud Storage bucket of name bucket.com.google.api.services.storage.Storage.Objects.DeletedeleteFromBucketRequest(String bucket, String pattern) Helper method to return the delete request.com.google.api.services.storage.model.StorageObjectuploadToBucket(String pattern, String bucket, com.google.api.client.http.InputStreamContent content) Uploads item with path pattern to Google Cloud Storage bucket of name bucket.com.google.api.services.storage.Storage.Objects.InsertuploadToBucketRequest(String pattern, String bucket, com.google.api.client.http.InputStreamContent content) Helper method to return the insert request.
- 
Constructor Details- 
StorageClientpublic StorageClient(com.google.api.services.storage.Storage storage) Constructs a newStorageClientinstance.- Parameters:
- storage- The- Storageinstance this class will utilize for interacting with the GCS API.
 
 
- 
- 
Method Details- 
deleteFromBucketDelete object matching pattern from Google Cloud Storage bucket of name bucket.- Parameters:
- bucket- GCS bucket to delete from.
- pattern- Pattern to match object name to delete from bucket.
- Throws:
- IOException- If there was an issue calling the GCS API.
 
- 
deleteFromBucketRequestpublic com.google.api.services.storage.Storage.Objects.Delete deleteFromBucketRequest(String bucket, String pattern) throws IOException Helper method to return the delete request.- Parameters:
- bucket- GCS bucket to delete from.
- pattern- Pattern to match object name to delete from bucket.
- Returns:
- Delete request.
- Throws:
- IOException- If there was an issue calling the GCS API.
 
- 
uploadToBucketpublic com.google.api.services.storage.model.StorageObject uploadToBucket(String pattern, String bucket, com.google.api.client.http.InputStreamContent content) throws IOException Uploads item with path pattern to Google Cloud Storage bucket of name bucket.- Parameters:
- pattern- Pattern to match object name to upload to bucket.
- bucket- Name of the bucket to upload to.
- content- InputStreamContent of desired file to upload.
- Returns:
- The parsed HTTP response from the request.
- Throws:
- IOException- If there was an issue calling the GCS API.
 
- 
uploadToBucketRequestpublic com.google.api.services.storage.Storage.Objects.Insert uploadToBucketRequest(String pattern, String bucket, com.google.api.client.http.InputStreamContent content) throws IOException Helper method to return the insert request.- Parameters:
- pattern- Pattern to match object name to upload to bucket.
- bucket- Name of the bucket to upload to.
- content- InputStreamContent of desired file to upload.
- Returns:
- Insert request.
- Throws:
- IOException- If there was an issue calling the GCS API.
 
- 
deleteBucketDelete bucket from GCS with name bucket. Bucket must be empty.- Parameters:
- bucket- Name of GCS bucket to delete.
- Throws:
- IOException- If there was an issue calling the GCS API.
 
- 
deleteBucketRequestpublic com.google.api.services.storage.Storage.Buckets.Delete deleteBucketRequest(String bucket) throws IOException Helper method to return the delete request.- Parameters:
- bucket- Name of GCS bucket to delete.
- Returns:
- Delete request.
- Throws:
- IOException- If there was an issue calling the GCS API.
 
 
-