I am using Google Cloud Storage Java Api to manage my bucket on Firebase. i have activated the versioning with gsutil using this command :
gsutil versioning set on gs://[BUCKET_NAME]
After that i tried to delete some files with this java code :
com.google.cloud.storage.Bucket bucket = com.google.firebase.cloud.StorageClient.getInstance().bucket();
com.google.cloud.storage.Blob doc = bucket.get(documentPath);
log.info("Deleting document info => " + doc.toString());
doc.delete();
Log : Deleting document info => Blob{bucket=[BUCKET_NAME], name=test.pdf, generation=1545929848902866, size=196220, content-type=application/pdf, metadata=null}
This works, but it removes both the live and the archived version of the file.
Please how to just delete the live version and conserve the archived one ?