use of javax.ws.rs.DELETE in project atlasmap by atlasmap.
the class AtlasService method removeMappingRequest.
@DELETE
@Path("/mapping/{mappingId}")
@Produces(MediaType.APPLICATION_JSON)
public Response removeMappingRequest(@PathParam("mappingId") String mappingId) {
java.nio.file.Path mappingFilePath = Paths.get(baseFolder + File.separator + generateMappingFileName(mappingId));
File mappingFile = mappingFilePath.toFile();
if (!mappingFile.exists()) {
return Response.noContent().build();
}
if (mappingFile != null && !mappingFile.delete()) {
LOG.warn("Unable to delete mapping file " + mappingFile.toString());
}
return Response.ok().build();
}
use of javax.ws.rs.DELETE in project scheduling by ow2-proactive.
the class SchedulerStateRest method deleteLiveLogJob.
/**
* remove the live log object.
*
* @param sessionId
* a valid session id
* @param jobId
* the id of the job to retrieve
* @throws NotConnectedRestException
*/
@Override
@DELETE
@Path("jobs/{jobid}/livelog")
@Produces("application/json")
public boolean deleteLiveLogJob(@HeaderParam("sessionid") String sessionId, @PathParam("jobid") String jobId) throws NotConnectedRestException {
checkAccess(sessionId, "delete /scheduler/jobs/livelog" + jobId);
Session ss = sessionStore.get(sessionId);
ss.getJobsOutputController().removeAppender(jobId);
return true;
}
use of javax.ws.rs.DELETE in project mica2 by obiba.
the class CurrentSessionResource method deleteSession.
@DELETE
public Response deleteSession() {
// Delete the Shiro session
try {
Session session = SecurityUtils.getSubject().getSession();
Object cookieValue = session.getAttribute(HttpHeaders.SET_COOKIE);
SecurityUtils.getSubject().logout();
if (cookieValue != null) {
NewCookie cookie = NewCookie.valueOf(cookieValue.toString());
if (OBIBA_ID_COOKIE_NAME.equals(cookie.getName())) {
return Response.ok().header(HttpHeaders.SET_COOKIE, new NewCookie(OBIBA_ID_COOKIE_NAME, null, "/", cookie.getDomain(), "Obiba session deleted", 0, cookie.isSecure())).build();
}
}
} catch (InvalidSessionException e) {
// Ignore
}
return Response.ok().build();
}
use of javax.ws.rs.DELETE in project mica2 by obiba.
the class DataAccessRequestResource method delete.
@DELETE
public Response delete(@PathParam("id") String id) {
subjectAclService.checkPermission("/data-access-request", "DELETE", id);
try {
dataAccessRequestService.delete(id);
// remove associated comments
commentsService.delete(DataAccessRequest.class.getSimpleName(), id);
eventBus.post(new ResourceDeletedEvent("/data-access-request", id));
eventBus.post(new ResourceDeletedEvent("/data-access-request/" + id, "_status"));
} catch (NoSuchDataAccessRequestException e) {
// ignore
}
return Response.noContent().build();
}
use of javax.ws.rs.DELETE in project mica2 by obiba.
the class CommentResource method deleteComment.
@DELETE
public Response deleteComment(@PathParam("id") String id, @PathParam("commentId") String commentId) {
subjectAclService.checkPermission(String.format("/draft/%s/%s/comment", service.getTypeName(), id), "DELETE", commentId);
service.findDraft(id);
commentsService.delete(commentId);
eventBus.post(new ResourceDeletedEvent(String.format("/draft/%s/%s/comment", service.getTypeName(), id), commentId));
return Response.noContent().build();
}
Aggregations