use of edu.harvard.iq.dataverse.engine.command.impl.DeletePrivateUrlCommand in project dataverse by IQSS.
the class DatasetPage method disablePrivateUrl.
public void disablePrivateUrl() {
try {
commandEngine.submit(new DeletePrivateUrlCommand(dvRequestService.getDataverseRequest(), dataset));
privateUrl = null;
JH.addSuccessMessage(BundleUtil.getStringFromBundle("dataset.privateurl.disabledSuccess"));
} catch (CommandException ex) {
logger.info("CommandException caught calling DeletePrivateUrlCommand: " + ex);
}
}
use of edu.harvard.iq.dataverse.engine.command.impl.DeletePrivateUrlCommand in project dataverse by IQSS.
the class Datasets method deletePrivateUrl.
@DELETE
@Path("{id}/privateUrl")
public Response deletePrivateUrl(@PathParam("id") String idSupplied) {
return response(req -> {
Dataset dataset = findDatasetOrDie(idSupplied);
PrivateUrl privateUrl = execCommand(new GetPrivateUrlCommand(req, dataset));
if (privateUrl != null) {
execCommand(new DeletePrivateUrlCommand(req, dataset));
return ok("Private URL deleted.");
} else {
return notFound("No Private URL to delete.");
}
});
}
Aggregations