org.fcrepo.server.rest
Class BaseRestResource

java.lang.Object
  extended by org.fcrepo.server.rest.BaseRestResource
Direct Known Subclasses:
DatastreamResource, FedoraObjectResource, FedoraObjectSearchResource, MethodResource, RelationshipResource, UploadResource

public class BaseRestResource
extends Object

A barebone RESTFUL resource implementation.

Version:
$Id$
Author:
cuong.tran@yourmediashelf.com

Field Summary
protected  Access apiAService
           
protected  Management apiMService
           
protected  DatastreamFilenameHelper datastreamFilenameHelper
           
protected  Server fedoraServer
           
protected  String fedoraServerHost
           
static String FORM
           
protected  javax.ws.rs.core.HttpHeaders headers
           
static String HTML
           
protected  org.codehaus.jackson.map.ObjectMapper mapper
           
protected  javax.servlet.http.HttpServletRequest servletRequest
           
static javax.ws.rs.core.MediaType TEXT_HTML
           
static javax.ws.rs.core.MediaType TEXT_XML
           
protected  javax.ws.rs.core.UriInfo uriInfo
           
static String XML
           
static String ZIP
           
 
Constructor Summary
BaseRestResource()
           
 
Method Summary
protected  javax.ws.rs.core.Response buildResponse(MIMETypedStream result)
           
protected  Context getContext()
           
protected  DefaultSerializer getSerializer(Context context)
           
protected  javax.ws.rs.core.Response handleException(Exception ex)
           
protected  void transform(String xml, String xslt, Writer out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORM

public static final String FORM
See Also:
Constant Field Values

HTML

public static final String HTML
See Also:
Constant Field Values

XML

public static final String XML
See Also:
Constant Field Values

ZIP

public static final String ZIP
See Also:
Constant Field Values

TEXT_HTML

public static final javax.ws.rs.core.MediaType TEXT_HTML

TEXT_XML

public static final javax.ws.rs.core.MediaType TEXT_XML

fedoraServer

protected Server fedoraServer

apiMService

protected Management apiMService

apiAService

protected Access apiAService

fedoraServerHost

protected String fedoraServerHost

mapper

protected org.codehaus.jackson.map.ObjectMapper mapper

datastreamFilenameHelper

protected DatastreamFilenameHelper datastreamFilenameHelper

servletRequest

@Context
protected javax.servlet.http.HttpServletRequest servletRequest

uriInfo

@Context
protected javax.ws.rs.core.UriInfo uriInfo

headers

@Context
protected javax.ws.rs.core.HttpHeaders headers
Constructor Detail

BaseRestResource

public BaseRestResource()
Method Detail

getContext

protected Context getContext()

getSerializer

protected DefaultSerializer getSerializer(Context context)

transform

protected void transform(String xml,
                         String xslt,
                         Writer out)
                  throws TransformerFactoryConfigurationError,
                         TransformerConfigurationException,
                         TransformerException
Throws:
TransformerFactoryConfigurationError
TransformerConfigurationException
TransformerException

buildResponse

protected javax.ws.rs.core.Response buildResponse(MIMETypedStream result)
                                           throws Exception
Throws:
Exception

handleException

protected javax.ws.rs.core.Response handleException(Exception ex)


Copyright © 2011 DuraSpace. All Rights Reserved.