view artifact-database/src/main/java/de/intevation/artifactdatabase/rest/BaseResource.java @ 47:4ae4dc99127d

Removed trailing whitespace. artifacts/trunk@167 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 01 Oct 2009 09:04:17 +0000
parents af22d4de275c
children 41c225c8bd41
line wrap: on
line source
package de.intevation.artifactdatabase.rest;

import org.apache.log4j.Logger;

import org.restlet.resource.ServerResource;
import org.restlet.resource.ResourceException;

import org.restlet.representation.Representation;

/**
 * @author Sascha L. Teichmann (sascha.teichmann@intevation)
 */
public class BaseResource
extends      ServerResource
{
    private static Logger logger = Logger.getLogger(BaseResource.class);

    public BaseResource() {
    }

    protected Representation post(Representation requestRepr)
    throws    ResourceException
    {
        try {
            return innerPost(requestRepr);
        }
        catch (ResourceException re) {
            throw re;
        }
        catch (RuntimeException re) {
            logger.error(re.getLocalizedMessage(), re);
            throw re;
        }
    }

    protected Representation innerPost(Representation requestRepr)
    throws    ResourceException
    {
        return super.post(requestRepr);
    }

    protected Representation get()
    throws    ResourceException
    {
        try {
            return innerGet();
        }
        catch (ResourceException re) {
            throw re;
        }
        catch (RuntimeException re) {
            logger.error(re.getLocalizedMessage(), re);
            throw re;
        }
    }

    protected Representation innerGet()
    throws    ResourceException
    {
        return super.get();
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

http://dive4elements.wald.intevation.org