use of com.microsoft.rest.v2.RestException in project geowebcache by GeoWebCache.
the class AzureBlobStore method delete.
@Override
public boolean delete(String layerName) throws StorageException {
checkNotNull(layerName, "layerName");
final String metadataKey = keyBuilder.layerMetadata(layerName);
final String layerPrefix = keyBuilder.forLayer(layerName);
// this might not be there, tolerant delete
try {
BlockBlobURL metadata = client.getBlockBlobURL(metadataKey);
int statusCode = metadata.delete().blockingGet().statusCode();
if (!HttpStatus.valueOf(statusCode).is2xxSuccessful()) {
return false;
}
} catch (RestException e) {
return false;
}
boolean layerExists = deleteManager.scheduleAsyncDelete(layerPrefix);
if (layerExists) {
listeners.sendLayerDeleted(layerName);
}
return layerExists;
}
Aggregations