class DataSetService extends BaseDataSetService {

    @RequestMapping(value = "/datasets/{id}", method = RequestMethod.DELETE)
    @ApiOperation(value = "Delete a data set by id",
            notes = "Delete a data set content based on provided id. Id should be a UUID returned by the list operation. Not valid or non existing data set id returns empty content.")
    @Timed
    public void delete(@PathVariable(value = "id") @ApiParam(name = "id",
            value = "Id of the data set to delete") String dataSetId) {
        DataSetMetadata metadata = dataSetMetadataRepository.get(dataSetId);
        final DistributedLock lock = dataSetMetadataRepository.createDatasetMetadataLock(dataSetId);
        try {
            lock.lock();
            // you can't delete a Dataset that is not completely updated
            if (metadata != null) {
                // first remove the metadata as there may be additional check
                dataSetMetadataRepository.remove(dataSetId);
                contentStore.delete(metadata);
            } else {
                HttpResponseContext.status(HttpStatus.NOT_FOUND);
            }
        } finally {
            lock.unlock();
        }
    }

}