What is the best way to make a copy of a blobstore object on a Java application platform?

Here is our simple usecase: user2 wants to copy the user1 document into its own repository in our application. It should be simple, right? All we need to do is create a second identical blob in the blobstore with the returned key, which we can associate with user2. We are missing something here. It seems that the main function of storing the block element of the application is to process drops downloaded and loaded into the browser, and the simple copy operation initiated on the server side is not so simple.

The obvious solution seemed to use the experimental api file in java, but not love. It works until you get a file size outside of MB or so, and then it fails, somewhat unpredictably. Reading all of this on the server layer also seems silly when we just need to make a copy at the storage level. In addition, the likelihood that we will receive an experimental function in our production environment is subtle, although non-zero.

Some information about our environment: the application is written in Java, and we use blobstore, not cloud storage, and are committed to this for now. We are a small departmental team and would like to make the application an excellent platform for use, but we are not in this. S3 makes it dazzlingly simple, is there really something stupid missing here?

+5
source share
3 answers

As a result, we abandoned the idea of ​​making a soft copy of blob with the api file and go with the link, as Kalle suggested in our comment, and created a new xref object that stores information about the copy and the original. When an image or file is deleted, we check the xfef object for links and delete those that point to this image / file (i.e., are created if the deleted image / file is copied from another). If we do not find any external links at all, we delete the blob itself. We did not like the consequences of confidentiality / compliance in leaving orphaned drops, and even though keeping cheap every $$$ helps. We also liked the idea of ​​keeping a clean house, so to speak.

+1

1: Google Compute Engine gsutil .

, .

gsutil

2. , , , , , . , , , .

, 0 , blob, , . Google App Engine. , , .

0

, blob . . - blob . delete? boolean delete. blob . , , true. , , - . .

0

All Articles