protected void addLinkAndOptionsHttpHeaders ( final FedoraResource resource ) { // Add Link headers addResourceLinkHeaders ( resource ) ; addAcceptExternalHeader ( ) ; // Add Options headers final String options ; if ( resource . isMemento ( ) ) { options = "GET,HEAD,OPTIONS,DELETE" ; } else if ( resource instanceof FedoraTimeMap ) { options = "POST,HEAD,GET,OPTIONS" ; servletResponse . addHeader ( "Vary-Post" , MEMENTO_DATETIME_HEADER ) ; addAcceptPostHeader ( ) ; } else if ( resource instanceof FedoraBinary ) { options = "DELETE,HEAD,GET,PUT,OPTIONS" ; } else if ( resource instanceof NonRdfSourceDescription ) { options = "HEAD,GET,DELETE,PUT,PATCH,OPTIONS" ; servletResponse . addHeader ( HTTP_HEADER_ACCEPT_PATCH , contentTypeSPARQLUpdate ) ; } else if ( resource instanceof Container ) { options = "MOVE,COPY,DELETE,POST,HEAD,GET,PUT,PATCH,OPTIONS" ; servletResponse . addHeader ( HTTP_HEADER_ACCEPT_PATCH , contentTypeSPARQLUpdate ) ; addAcceptPostHeader ( ) ; } else { options = "" ; } servletResponse . addHeader ( "Allow" , options ) ; }
Add Link and Option headers