src/main/java/org/trellisldp/http/impl/OptionsHandler.java
/**
     * Build the representation for the given resource
     * @param res the resource
     * @return the response builder
     */
Build the representation for the given resource
@param res the resource
@return the response builder
Build the representation for the given resource @param res the resource @return the response builder
public ResponseBuilder ldpOptions(final Resource res) {
        final String identifier = getBaseUrl() + req.getPartition() + req.getPath();
        LOGGER.debug("OPTIONS request for {}", identifier);
        final IRI graphName = ACL.equals(req.getExt()) ? PreferAccessControl : PreferUserManaged;
        checkDeleted(res, identifier);
        final ResponseBuilder builder = status(NO_CONTENT);
        ldpResourceTypes(res.getInteractionModel()).forEach(type -> builder.link(type.getIRIString(), "type"));
        if (res.isMemento() || TIMEMAP.equals(req.getExt())) {
            builder.header(ALLOW, join(",", GET, HEAD, OPTIONS));
        } else {
            builder.header(ACCEPT_PATCH, APPLICATION_SPARQL_UPDATE);
            if (PreferAccessControl.equals(graphName) || res.getInteractionModel().equals(RDFSource) ||
                    res.getInteractionModel().equals(NonRDFSource)) {
                builder.header(ALLOW, join(",", GET, HEAD, OPTIONS, PATCH, PUT, DELETE));
            } else {
                builder.header(ALLOW, join(",", GET, HEAD, OPTIONS, PATCH, PUT, DELETE, POST));
                builder.header(ACCEPT_POST, MEDIA_TYPES.stream().map(mt -> mt.getType() + "/" + mt.getSubtype())
                        .filter(mt -> !TEXT_HTML.equals(mt)).collect(joining(",")));
            }
        }
        return builder;
    }
public ResponseBuilder ldpOptions ( final Resource res ) { final String identifier = getBaseUrl ( ) + req . getPartition ( ) + req . getPath ( ) ; LOGGER . debug ( "OPTIONS request for {}" , identifier ) ; final IRI graphName = ACL . equals ( req . getExt ( ) ) ? PreferAccessControl : PreferUserManaged ; checkDeleted ( res , identifier ) ; final ResponseBuilder builder = status ( NO_CONTENT ) ; ldpResourceTypes ( res . getInteractionModel ( ) ) . forEach ( type -> builder . link ( type . getIRIString ( ) , "type" ) ) ; if ( res . isMemento ( ) || TIMEMAP . equals ( req . getExt ( ) ) ) { builder . header ( ALLOW , join ( "," , GET , HEAD , OPTIONS ) ) ; } else { builder . header ( ACCEPT_PATCH , APPLICATION_SPARQL_UPDATE ) ; if ( PreferAccessControl . equals ( graphName ) || res . getInteractionModel ( ) . equals ( RDFSource ) || res . getInteractionModel ( ) . equals ( NonRDFSource ) ) { builder . header ( ALLOW , join ( "," , GET , HEAD , OPTIONS , PATCH , PUT , DELETE ) ) ; } else { builder . header ( ALLOW , join ( "," , GET , HEAD , OPTIONS , PATCH , PUT , DELETE , POST ) ) ; builder . header ( ACCEPT_POST , MEDIA_TYPES . stream ( ) . map ( mt -> mt . getType ( ) + "/" + mt . getSubtype ( ) ) . filter ( mt -> ! TEXT_HTML . equals ( mt ) ) . collect ( joining ( "," ) ) ) ; } } return builder ; }
Build the representation for the given resource
 @param res the resource
 @return the response builder
Build the representation for the given resource @param res the resource @return the response builder
// Check if this is already deleted // Mementos and TimeMaps are read-only // ACL resources allow a limited set of methods (no DELETE or POST) // If it's not a container, POST isn't allowed // Containers and binaries support POST