Saturday, January 21, 2017

Google Storage By Java


If you were deleted all files in folder then folder also deleted.
final Storage storage = StorageOptions.getDefaultInstance().getService();
boolean succeed = storage.delete(BlobId.of("bucket-name", "1/lenna.jpg"));
if (succeed) {
  // File was deleted.
}
else {
  // File not found!
}

ref. https://cloud.google.com/appengine/docs/flexible/java/using-cloud-storage