public ResponseBuilder standardHeaders ( final ResponseBuilder builder ) { // Standard HTTP Headers builder . lastModified ( from ( getResource ( ) . getModified ( ) ) ) . header ( VARY , ACCEPT ) ; final IRI model ; if ( getRequest ( ) . getExt ( ) == null || DESCRIPTION . equals ( getRequest ( ) . getExt ( ) ) ) { if ( syntax != null ) { builder . header ( VARY , PREFER ) ; builder . type ( syntax . mediaType ( ) ) ; } model = getResource ( ) . getBinaryMetadata ( ) . isPresent ( ) && syntax != null ? LDP . RDFSource : getResource ( ) . getInteractionModel ( ) ; // Link headers from User data getResource ( ) . getExtraLinkRelations ( ) . collect ( toMap ( Entry :: getKey , Entry :: getValue ) ) . entrySet ( ) . forEach ( entry -> builder . link ( entry . getKey ( ) , join ( " " , entry . getValue ( ) ) ) ) ; } else { model = LDP . RDFSource ; } // Add LDP-required headers addLdpHeaders ( builder , model ) ; // Memento-related headers addMementoHeaders ( builder ) ; return builder ; }
Get the standard headers .