Interface ObjectApi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GoogleCloudStorageObject
composeObjects(String destinationBucket, String destinationObject, ComposeObjectTemplate composeObjectTemplate)
Concatenates a list of existing objects into a new object in the same bucket.GoogleCloudStorageObject
composeObjects(String destinationBucket, String destinationObject, ComposeObjectTemplate composeObjectTemplate, ComposeObjectOptions options)
Concatenates a list of existing objects into a new object in the same bucket.GoogleCloudStorageObject
copyObject(String destinationBucket, String destinationObject, String sourceBucket, String sourceObject)
Copies an object to a specified location.GoogleCloudStorageObject
copyObject(String destinationBucket, String destinationObject, String sourceBucket, String sourceObject, ObjectTemplate template)
Copies an object to a specified location with updated metadata.GoogleCloudStorageObject
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.PayloadEnclosing
download(String bucketName, String objectName)
Retrieve an object or their metadataPayloadEnclosing
download(String bucketName, String objectName, HttpRequestOptions options)
Retrieves objectsGoogleCloudStorageObject
getObject(String bucketName, String objectName)
Retrieve an object metadataGoogleCloudStorageObject
getObject(String bucketName, String objectName, HttpRequestOptions options)
Retrieves objects metadataListPageWithPrefixes<GoogleCloudStorageObject>
listObjects(String bucketName)
Retrieves a list of objects matching the criteria.ListPageWithPrefixes<GoogleCloudStorageObject>
listObjects(String bucketName, ListObjectOptions options)
Retrieves a list of objects matching the criteria.GoogleCloudStorageObject
multipartUpload(String bucketName, ObjectTemplate objectTemplate, Payload payload)
Stores a new object with metadata.boolean
objectExists(String bucketName, String objectName)
Check the existence of an objectGoogleCloudStorageObject
patchObject(String bucketName, String objectName, ObjectTemplate objectTemplate)
Updates an object according to patch semanticsGoogleCloudStorageObject
patchObject(String bucketName, String objectName, ObjectTemplate objectTemplate, UpdateObjectOptions options)
Updates an object according to patch semanticsRewriteResponse
rewriteObjects(String destinationBucket, String destinationObject, String sourceBucket, String sourceObject)
Rewrites a source object to a destination object.RewriteResponse
rewriteObjects(String destinationBucket, String destinationObject, String sourceBucket, String sourceObject, RewriteObjectOptions options)
Rewrites a source object to a destination object.GoogleCloudStorageObject
simpleUpload(String bucketName, String contentType, Long contentLength, Payload payload, InsertObjectOptions options)
Stores a new object.GoogleCloudStorageObject
updateObject(String bucketName, String objectName, ObjectTemplate objectTemplate)
Updates an object metadataGoogleCloudStorageObject
updateObject(String bucketName, String objectName, ObjectTemplate objectTemplate, UpdateObjectOptions options)
Updates an object
-
-
-
Method Detail
-
objectExists
@Named("Object:Exist") @GET @Path("storage/v1/b/{bucket}/o/{object}") boolean objectExists(@PathParam("bucket") String bucketName, @PathParam("object") @Encoded String objectName)
Check the existence of an object- Parameters:
bucketName
- Name of the bucket in which the object residesobjectName
- Name of the object- Returns:
- a
Object
true if object exists
-
getObject
@Named("Object:get") @GET @Path("storage/v1/b/{bucket}/o/{object}") @Consumes("application/json") @Nullable GoogleCloudStorageObject getObject(@PathParam("bucket") String bucketName, @PathParam("object") @Encoded String objectName)
Retrieve an object metadata- Parameters:
bucketName
- Name of the bucket in which the object residesobjectName
- Name of the object- Returns:
- a
Object
resource
-
getObject
@Named("Object:get") @GET @Path("storage/v1/b/{bucket}/o/{object}") @Consumes("application/json") @Nullable GoogleCloudStorageObject getObject(@PathParam("bucket") String bucketName, @PathParam("object") @Encoded String objectName, HttpRequestOptions options)
Retrieves objects metadata- Parameters:
bucketName
- Name of the bucket in which the object residesobjectName
- Name of the objectoptions
- A class that implementsHttpRequestOptions
such asGetObjectOptions
with optional query parameters- Returns:
- a
GoogleCloudStorageObject
-
download
@Named("Object:get") @GET @Path("storage/v1/b/{bucket}/o/{object}") @Nullable PayloadEnclosing download(@PathParam("bucket") String bucketName, @PathParam("object") @Encoded String objectName)
Retrieve an object or their metadata- Parameters:
bucketName
- Name of the bucket in which the object residesobjectName
- Name of the object- Returns:
- a
Object
resource
-
download
@Named("Object:get") @GET @Path("storage/v1/b/{bucket}/o/{object}") @Nullable PayloadEnclosing download(@PathParam("bucket") String bucketName, @PathParam("object") @Encoded String objectName, HttpRequestOptions options)
Retrieves objects- Parameters:
bucketName
- Name of the bucket in which the object residesobjectName
- Name of the objectoptions
- A class that implementsHttpRequestOptions
such asGetObjectOptions
with optional query parameters- Returns:
- a
GoogleCloudStorageObject
-
simpleUpload
@Named("Object:simpleUpload") @POST @Consumes("application/json") @Path("/upload/storage/v1/b/{bucket}/o") GoogleCloudStorageObject simpleUpload(@PathParam("bucket") String bucketName, @HeaderParam("Content-Type") String contentType, @HeaderParam("Content-Length") Long contentLength, Payload payload, InsertObjectOptions options)
Stores a new object. Object metadata setting is not supported with simple uploads- Parameters:
bucketName
- Name of the bucket in which the object to be storedoptions
- Supply anInsertObjectOptions
. 'name' should not null.- Returns:
- a
GoogleCloudStorageObject
-
deleteObject
@Named("Object:delete") @DELETE @Path("storage/v1/b/{bucket}/o/{object}") boolean deleteObject(@PathParam("bucket") String bucketName, @PathParam("object") @Encoded 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 residesobjectName
- Name of the object
-
deleteObject
@Named("Object:delete") @DELETE @Path("storage/v1/b/{bucket}/o/{object}") boolean deleteObject(@PathParam("bucket") String bucketName, @PathParam("object") @Encoded 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 residesobjectName
- Name of the objectoptions
- SupplyDeleteObjectOptions
with optional query parameters
-
listObjects
@Named("Object:list") @GET @Consumes("application/json") @Path("storage/v1/b/{bucket}/o") ListPageWithPrefixes<GoogleCloudStorageObject> listObjects(@PathParam("bucket") String bucketName)
Retrieves a list of objects matching the criteria.- Parameters:
bucketName
- Name of the bucket in which to look for objects.
-
listObjects
@Named("Object:list") @GET @Consumes("application/json") @Path("storage/v1/b/{bucket}/o") ListPageWithPrefixes<GoogleCloudStorageObject> listObjects(@PathParam("bucket") 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
- SupplyListObjectOptions
- Returns:
- a
ListPage
-
updateObject
@Named("Object:update") @PUT @Consumes("application/json") @Produces("application/json") @Path("storage/v1/b/{bucket}/o/{object}") GoogleCloudStorageObject updateObject(@PathParam("bucket") String bucketName, @PathParam("object") @Encoded String objectName, ObjectTemplate objectTemplate)
Updates an object metadata- Parameters:
bucketName
- Name of the bucket in which the object residesobjectName
- Name of the objectobjectTemplate
- Supply anObjectTemplate
- Returns:
- a
GoogleCloudStorageObject
-
updateObject
@Named("Object:update") @PUT @Consumes("application/json") @Produces("application/json") @Path("storage/v1/b/{bucket}/o/{object}") GoogleCloudStorageObject updateObject(@PathParam("bucket") String bucketName, @PathParam("object") @Encoded String objectName, ObjectTemplate objectTemplate, UpdateObjectOptions options)
Updates an object- Parameters:
bucketName
- Name of the bucket in which the object residesobjectName
- Name of the objectobjectTemplate
- Supply anObjectTemplate
options
- SupplyUpdateObjectOptions
with optional query parameters- Returns:
- a
GoogleCloudStorageObject
.
-
patchObject
@Named("Object:patch") @Consumes("application/json") @Produces("application/json") @Path("storage/v1/b/{bucket}/o/{object}") GoogleCloudStorageObject patchObject(@PathParam("bucket") String bucketName, @PathParam("object") @Encoded String objectName, ObjectTemplate objectTemplate)
Updates an object according to patch semantics- Parameters:
bucketName
- Name of the bucket in which the object residesobjectName
- Name of the objectobjectTemplate
- SupplyObjectTemplate
with optional query parameters- Returns:
- a
GoogleCloudStorageObject
-
patchObject
@Named("Object:patch") @PUT @Consumes("application/json") @Produces("application/json") @Path("storage/v1/b/{bucket}/o/{object}") GoogleCloudStorageObject patchObject(@PathParam("bucket") String bucketName, @PathParam("object") @Encoded String objectName, ObjectTemplate objectTemplate, UpdateObjectOptions options)
Updates an object according to patch semantics- Parameters:
bucketName
- Name of the bucket in which the object residesobjectName
- Name of the objectobjectTemplate
- SupplyObjectTemplate
with optional query parametersoptions
- SupplyUpdateObjectOptions
with optional query parameters- Returns:
- a
GoogleCloudStorageObject
-
composeObjects
@Named("Object:compose") @POST @Consumes("application/json") @Path("storage/v1/b/{destinationBucket}/o/{destinationObject}/compose") GoogleCloudStorageObject composeObjects(@PathParam("destinationBucket") String destinationBucket, @PathParam("destinationObject") @Encoded 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 storeddestinationObject
- The type of upload request.composeObjectTemplate
- Supply aComposeObjectTemplate
- Returns:
- a
GoogleCloudStorageObject
-
composeObjects
@Named("Object:compose") @POST @Consumes("application/json") @Path("storage/v1/b/{destinationBucket}/o/{destinationObject}/compose") GoogleCloudStorageObject composeObjects(@PathParam("destinationBucket") String destinationBucket, @PathParam("destinationObject") @Encoded 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 storeddestinationObject
- The type of upload request.composeObjectTemplate
- Supply aComposeObjectTemplate
options
- Supply anComposeObjectOptions
- Returns:
- a
GoogleCloudStorageObject
-
copyObject
@Named("Object:copy") @POST @Consumes("application/json") @Path("/storage/v1/b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}") GoogleCloudStorageObject copyObject(@PathParam("destinationBucket") String destinationBucket, @PathParam("destinationObject") @Encoded String destinationObject, @PathParam("sourceBucket") String sourceBucket, @PathParam("sourceObject") @Encoded String sourceObject)
Copies an object to a specified location.- Parameters:
destinationBucket
- Name of the bucket in which to store the new objectdestinationObject
- Name of the new object.sourceBucket
- Name of the bucket in which to find the source objectsourceObject
- Name of the source object- Returns:
- a
GoogleCloudStorageObject
-
copyObject
@Named("Object:copy") @POST @Consumes("application/json") @Path("/storage/v1/b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}") GoogleCloudStorageObject copyObject(@PathParam("destinationBucket") String destinationBucket, @PathParam("destinationObject") @Encoded String destinationObject, @PathParam("sourceBucket") String sourceBucket, @PathParam("sourceObject") @Encoded String sourceObject, ObjectTemplate template)
Copies an object to a specified location with updated metadata.- Parameters:
destinationBucket
- Name of the bucket in which to store the new objectdestinationObject
- Name of the new object.sourceBucket
- Name of the bucket in which to find the source objectsourceObject
- Name of the source objecttemplate
- Supply aCopyObjectOptions
- Returns:
- a
GoogleCloudStorageObject
-
copyObject
@Named("Object:copy") @POST @Consumes("application/json") @Path("/storage/v1/b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}") GoogleCloudStorageObject copyObject(@PathParam("destinationBucket") String destinationBucket, @PathParam("destinationObject") @Encoded String destinationObject, @PathParam("sourceBucket") String sourceBucket, @PathParam("sourceObject") @Encoded 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 objectdestinationObject
- Name of the new object.sourceBucket
- Name of the bucket in which to find the source objectsourceObject
- Name of the source objectoptions
- Supply aCopyObjectOptions
- Returns:
- a
GoogleCloudStorageObject
-
multipartUpload
@Named("Object:multipartUpload") @POST @Consumes("application/json") @Path("/upload/storage/v1/b/{bucket}/o") GoogleCloudStorageObject multipartUpload(@PathParam("bucket") String bucketName, ObjectTemplate objectTemplate, Payload payload)
Stores a new object with metadata.- Parameters:
bucketName
- Name of the bucket in which the object to be storedobjectTemplate
- Supply anObjectTemplate
.- Returns:
- a
GoogleCloudStorageObject
-
rewriteObjects
@Named("Object:rewrite") @POST @Consumes("application/json") @Path("/storage/v1/b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}") RewriteResponse rewriteObjects(@PathParam("destinationBucket") String destinationBucket, @PathParam("destinationObject") @Encoded String destinationObject, @PathParam("sourceBucket") String sourceBucket, @PathParam("sourceObject") @Encoded String sourceObject)
Rewrites a source object to a destination object.- Parameters:
destinationBucket
- Name of the bucket in which the object to be storeddestinationObject
- 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
RewriteResponse
-
rewriteObjects
@Named("Object:rewrite") @POST @Consumes("application/json") @Path("/storage/v1/b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}") RewriteResponse rewriteObjects(@PathParam("destinationBucket") String destinationBucket, @PathParam("destinationObject") @Encoded String destinationObject, @PathParam("sourceBucket") String sourceBucket, @PathParam("sourceObject") @Encoded String sourceObject, RewriteObjectOptions options)
Rewrites a source object to a destination object.- Parameters:
destinationBucket
- Name of the bucket in which the object to be storeddestinationObject
- 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 anRewriteObjectOptions
- Returns:
- a
RewriteResponse
-
-