org.jclouds.googlecloudstorage.features
Interface ObjectApi


public interface ObjectApi

Provides access to Object entities via their REST API.

See Also:

Method Summary
 GCSObject composeObjects(String destinationBucket, String destinationObject, ComposeObjectTemplate composeObjectTemplate)
          Concatenates a list of existing objects into a new object in the same bucket.
 GCSObject composeObjects(String destinationBucket, String destinationObject, ComposeObjectTemplate composeObjectTemplate, ComposeObjectOptions options)
          Concatenates a list of existing objects into a new object in the same bucket.
 GCSObject copyObject(String destinationBucket, String destinationObject, String sourceBucket, String sourceObject)
          Copies an object to a specified location.
 GCSObject copyObject(String destinationBucket, String destinationObject, String sourceBucket, String sourceObject, CopyObjectOptions options)
          Copies an object to a specified location.
 boolean deleteObject(String bucketName, String objectName)
          Deletes an object and its metadata.
 boolean deleteObject(String bucketName, String objectName, DeleteObjectOptions options)
          Deletes an object and its metadata.
 org.jclouds.http.internal.PayloadEnclosingImpl download(String bucketName, String objectName)
          Retrieve an object or their metadata
 org.jclouds.http.internal.PayloadEnclosingImpl download(String bucketName, String objectName, GetObjectOptions options)
          Retrieves objects
 GCSObject getObject(String bucketName, String objectName)
          Retrieve an object metadata
 GCSObject getObject(String bucketName, String objectName, GetObjectOptions options)
          Retrieves objects metadata
 ListPage<GCSObject> listObjects(String bucketName)
          Retrieves a list of objects matching the criteria.
 ListPage<GCSObject> listObjects(String bucketName, ListObjectOptions options)
          Retrieves a list of objects matching the criteria.
 GCSObject multipartUpload(String bucketName, ObjectTemplate objectTemplate, org.jclouds.io.Payload payload)
          Stores a new object with metadata.
 boolean objectExist(String bucketName, String objectName)
          Check the existence of an object
 GCSObject patchObject(String bucketName, String objectName, ObjectTemplate objectTemplate)
          Updates an object according to patch semantics
 GCSObject patchObject(String bucketName, String objectName, ObjectTemplate objectTemplate, UpdateObjectOptions options)
          Updates an object according to patch semantics
 GCSObject simpleUpload(String bucketName, String contentType, Long contentLength, org.jclouds.io.Payload payload, InsertObjectOptions Options)
          Stores a new object.Bject metadata setting is not supported with simple uploads
 GCSObject updateObject(String bucketName, String objectName, ObjectTemplate objectTemplate)
          Updates an object metadata
 GCSObject updateObject(String bucketName, String objectName, ObjectTemplate objectTemplate, UpdateObjectOptions options)
          Updates an object
 

Method Detail

objectExist

@Named(value="Object:Exist")
@Nullable
boolean objectExist(String bucketName,
                                   String objectName)
Check the existence of an object

Parameters:
bucketName - Name of the bucket in which the object resides
objectName - Name of the object
Returns:
a Object true if object exists

getObject

@Named(value="Object:get")
@Nullable
GCSObject getObject(String bucketName,
                                   String objectName)
Retrieve an object metadata

Parameters:
bucketName - Name of the bucket in which the object resides
objectName - Name of the object
Returns:
a Object resource

getObject

@Named(value="Object:get")
@Nullable
GCSObject getObject(String bucketName,
                                   String objectName,
                                   GetObjectOptions options)
Retrieves objects metadata

Parameters:
bucketName - Name of the bucket in which the object resides
objectName - Name of the object
options - Supply GetObjectOptions with optional query parameters
Returns:
a GCSObject

download

@Named(value="Object:get")
@Nullable
org.jclouds.http.internal.PayloadEnclosingImpl download(String bucketName,
                                                                       String objectName)
Retrieve an object or their metadata

Parameters:
bucketName - Name of the bucket in which the object resides
objectName - Name of the object
Returns:
a Object resource

download

@Named(value="Object:get")
@Nullable
org.jclouds.http.internal.PayloadEnclosingImpl download(String bucketName,
                                                                       String objectName,
                                                                       GetObjectOptions options)
Retrieves objects

Parameters:
bucketName - Name of the bucket in which the object resides
objectName - Name of the object
options - Supply GetObjectOptions with optional query parameters
Returns:
a GCSObject

simpleUpload

@Named(value="Object:simpleUpload")
GCSObject simpleUpload(String bucketName,
                             @HeaderParam(value="Content-Type")
                             String contentType,
                             @HeaderParam(value="Content-Length")
                             Long contentLength,
                             org.jclouds.io.Payload payload,
                             InsertObjectOptions Options)
Stores a new object.Bject metadata setting is not supported with simple uploads

Parameters:
bucketName - Name of the bucket in which the object to be stored
options - Supply an InsertObjectOptions. 'name' should not null.
Returns:
a GCSObject
See Also:
https://developers.google.com/storage/docs/json_api/v1/how-tos/upload#simple

deleteObject

@Named(value="Object:delete")
boolean deleteObject(String bucketName,
                           String objectName)
Deletes an object and its metadata. Deletions are permanent if versioning is not enabled.

Parameters:
bucketName - Name of the bucket in which the object to be deleted resides
objectName - Name of the object

deleteObject

@Named(value="Object:delete")
boolean deleteObject(String bucketName,
                           String objectName,
                           DeleteObjectOptions options)
Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.

Parameters:
bucketName - Name of the bucket in which the object to be deleted resides
objectName - Name of the object
options - Supply DeletObjectOptions with optional query parameters

listObjects

@Named(value="Object:list")
@Nullable
ListPage<GCSObject> listObjects(String bucketName)
Retrieves a list of objects matching the criteria.

Parameters:
bucketName - Name of the bucket in which to look for objects.
Returns:
a ListPage

listObjects

@Named(value="Object:list")
@Nullable
ListPage<GCSObject> listObjects(String bucketName,
                                               ListObjectOptions options)
Retrieves a list of objects matching the criteria.

Parameters:
bucketName - Name of the bucket in which to look for objects.
options - Supply ListObjectOptions
Returns:
a ListPage

updateObject

@Named(value="Object:update")
GCSObject updateObject(String bucketName,
                             String objectName,
                             ObjectTemplate objectTemplate)
Updates an object metadata

Parameters:
bucketName - Name of the bucket in which the object resides
objectName - Name of the object
objectTemplate - Supply an ObjectTemplate
Returns:
a GCSObject

updateObject

@Named(value="Object:update")
GCSObject updateObject(String bucketName,
                             String objectName,
                             ObjectTemplate objectTemplate,
                             UpdateObjectOptions options)
Updates an object

Parameters:
bucketName - Name of the bucket in which the object resides
objectName - Name of the object
objectTemplate - Supply anObjectTemplate
options - Supply UpdateObjectOptions with optional query parameters
Returns:
a GCSObject .

patchObject

@Named(value="Object:patch")
GCSObject patchObject(String bucketName,
                            String objectName,
                            ObjectTemplate objectTemplate)
Updates an object according to patch semantics

Parameters:
bucketName - Name of the bucket in which the object resides
objectName - Name of the object
objectTemplate - Supply ObjectTemplate with optional query parameters
Returns:
a GCSObject

patchObject

@Named(value="Object:patch")
GCSObject patchObject(String bucketName,
                            String objectName,
                            ObjectTemplate objectTemplate,
                            UpdateObjectOptions options)
Updates an object according to patch semantics

Parameters:
bucketName - Name of the bucket in which the object resides
objectName - Name of the object
objectTemplate - Supply ObjectTemplate with optional query parameters
options - Supply UpdateObjectOptions with optional query parameters
Returns:
a GCSObject

composeObjects

@Named(value="Object:compose")
GCSObject composeObjects(String destinationBucket,
                               String destinationObject,
                               ComposeObjectTemplate composeObjectTemplate)
Concatenates a list of existing objects into a new object in the same bucket.

Parameters:
destinationBucket - Name of the bucket in which the object to be stored
destinationObject - The type of upload request.
composeObjectTemplate - Supply a ComposeObjectTemplate
Returns:
a GCSObject

composeObjects

@Named(value="Object:compose")
GCSObject composeObjects(String destinationBucket,
                               String destinationObject,
                               ComposeObjectTemplate composeObjectTemplate,
                               ComposeObjectOptions options)
Concatenates a list of existing objects into a new object in the same bucket.

Parameters:
destinationBucket - Name of the bucket in which the object to be stored
destinationObject - The type of upload request.
composeObjectTemplate - Supply a ComposeObjectTemplate
options - Supply an ComposeObjectOptions
Returns:
a GCSObject

copyObject

@Named(value="Object:copy")
GCSObject copyObject(String destinationBucket,
                           String destinationObject,
                           String sourceBucket,
                           String sourceObject)
Copies an object to a specified location. Optionally overrides metadata.

Parameters:
destinationBucket - Name of the bucket in which to store the new object
destinationObject - Name of the new object.
sourceBucket - Name of the bucket in which to find the source object
sourceObject - Name of the source object
Returns:
a GCSObject

copyObject

@Named(value="Object:copy")
GCSObject copyObject(String destinationBucket,
                           String destinationObject,
                           String sourceBucket,
                           String sourceObject,
                           CopyObjectOptions options)
Copies an object to a specified location. Optionally overrides metadata.

Parameters:
destinationBucket - Name of the bucket in which to store the new object
destinationObject - Name of the new object.
sourceBucket - Name of the bucket in which to find the source object
sourceObject - Name of the source object
options - Supply a CopyObjectOptions
Returns:
a GCSObject

multipartUpload

@Named(value="Object:multipartUpload")
GCSObject multipartUpload(String bucketName,
                                ObjectTemplate objectTemplate,
                                org.jclouds.io.Payload payload)
Stores a new object with metadata.

Parameters:
bucketName - Name of the bucket in which the object to be stored
objectTemplate - Supply an ObjectTemplate.
Returns:
a GCSObject
See Also:
https://developers.google.com/storage/docs/json_api/v1/how-tos/upload#multipart


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.