Check for existence of snapshot index file before attempting delete

This commit is contained in:
Jason Tedor 2015-07-27 13:28:37 -04:00
parent 1a8c4019a7
commit cdd2da1e1c
1 changed files with 3 additions and 1 deletions

View File

@ -561,7 +561,9 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent<Rep
}
bRef = bStream.bytes();
}
snapshotsBlobContainer.deleteBlob(SNAPSHOTS_FILE);
if (snapshotsBlobContainer.blobExists(SNAPSHOTS_FILE)) {
snapshotsBlobContainer.deleteBlob(SNAPSHOTS_FILE);
}
try (OutputStream output = snapshotsBlobContainer.createOutput(SNAPSHOTS_FILE)) {
bRef.writeTo(output);
}