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

com.github.dynamicextensionsalfresco.webscripts.resolutions.ErrorResolution Maven / Gradle / Ivy

Go to download

Adds an OSGi container to alfresco repository supporting dynamic code reloading, classpath isolation and a bunch of other useful features

There is a newer version: 3.1.0
Show newest version
package com.github.dynamicextensionsalfresco.webscripts.resolutions;

import com.github.dynamicextensionsalfresco.webscripts.AnnotationWebScriptRequest;
import com.github.dynamicextensionsalfresco.webscripts.AnnotationWebscriptResponse;

import java.io.IOException;

/**
 * @author Laurent Van der Linden
 *
 * @deprecated replaced with @see {@link StatusResolution}
 */
public class ErrorResolution implements Resolution {
    private int status;
    private String message;

    public ErrorResolution(int status) {
        this.status = status;
    }

    public ErrorResolution(int status, String message) {
        this.status = status;
        this.message = message;
    }

    @Override
    public void resolve(AnnotationWebScriptRequest request, AnnotationWebscriptResponse response, ResolutionParameters params) throws IOException {
        response.setStatus(status);
        if (message != null) {
            response.getWriter().append(message);
        }
    }

    public int getStatus() {
        return status;
    }

    public String getMessage() {
        return message;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy