All Downloads are FREE. Search and download functionalities are using the official Maven repository.

z11.rs.exception.RestException Maven / Gradle / Ivy

There is a newer version: 1.8
Show newest version
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package z11.rs.exception;

import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;

/**
 *
 * @author danny
 */
public abstract class RestException extends Exception {
    
    public RestException(String message) {
        super(message);
    }
    public abstract Response makeHttpResponse();
    
    protected Response makeHttpResponse(Status status) {
        return Response.status(status).entity(getMessage()).type(MediaType.TEXT_PLAIN).build();
    
    }
    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy