I expected the following call to rename an object. Unfortunately, its behaviour is not the expected, and it's very different from other similar calls like setMetadata().
Storage gcs = ...;
gcs.update(BlobInfo.newBuilder("existingBucket", "existingObject")
.setBlobId(BlobId.of("existingBucket", "newObject"))
.build());
AFAICT, this tries to make a dummy update to gs://existingBucket/newObject, which fails because the URI doesn't exist.
Logically, the behaviour of this call should be to rename the object, which is what I want to do, and appears to be impossible as per this: gsutil mv copies and removes, which ideally we would avoid doing.
Is there any way to rename a file that doesn't involve copying and removing?
If not, then I'd like to request one.
I expected the following call to rename an object. Unfortunately, its behaviour is not the expected, and it's very different from other similar calls like
setMetadata().AFAICT, this tries to make a dummy update to
gs://existingBucket/newObject, which fails because the URI doesn't exist.Logically, the behaviour of this call should be to rename the object, which is what I want to do, and appears to be impossible as per this:
gsutil mvcopies and removes, which ideally we would avoid doing.Is there any way to rename a file that doesn't involve copying and removing?
If not, then I'd like to request one.