Saturday, 15 August 2015

java - Copy Cloud Storage File ( create a duplicate of the file ) -


I used to upload a file, and my files are stored on Google Cloud Storage within a specified bucket. Used to be.

Structure

I am storing files in cloud storage and keep it BlobKey to manage it anywhere , Whenever I need to serve it I use

  Blob's Blobke = Service. Creation Blob (BlobString); Service.serve (Blobby, Feedback);  My requirement   

I want to give the user a function so that the user can copy the file. I do not know how this can be done. Will I be able to get raw byte [] and store it back on cloud storage? There is no such method in the API.

You GcsServiceFactory class, which has been documented, and its one Overloading of static method is called to get an example of the interface GcsService on the createGCSService , which, in turn, is documented on.

The latter method is copy , see, com.google.appengine.tools.cloudstorage.GcsFilename), that's what you are looking for.

GCSFileName , which has two examples that you have to go through in the copy method, is documented - it's really simple, as You can see from its creator:

  GcsFilename (java.lang.String bucketName, java.lang.String objectName)  

Therefore it is essentially Only the name of the bucket and the object name inside it.


No comments:

Post a Comment