mirror of https://github.com/sismics/docs.git
32 lines
862 B
Java
32 lines
862 B
Java
package com.sismics.rest.exception;
|
|
|
|
import javax.ws.rs.WebApplicationException;
|
|
import javax.ws.rs.core.Response;
|
|
import javax.ws.rs.core.Response.Status;
|
|
|
|
import org.codehaus.jettison.json.JSONException;
|
|
import org.codehaus.jettison.json.JSONObject;
|
|
|
|
/**
|
|
* Unauthorized access to the resource exception.
|
|
*
|
|
* @author jtremeaux
|
|
*/
|
|
public class ForbiddenClientException extends WebApplicationException {
|
|
/**
|
|
* Serial UID.
|
|
*/
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
/**
|
|
* Constructor of ForbiddenClientException.
|
|
*
|
|
* @throws JSONException
|
|
*/
|
|
public ForbiddenClientException() throws JSONException {
|
|
super(Response.status(Status.FORBIDDEN).entity(new JSONObject()
|
|
.put("type", "ForbiddenError")
|
|
.put("message", "You don't have access to this resource")).build());
|
|
}
|
|
}
|