protected AbstractPolicy loadObjectPolicy ( PolicyParser policyParser , String pid , boolean validate ) throws ServerException { try { DOReader reader = m_repoReader . getReader ( Server . USE_DEFINITIVE_STORE , ReadOnlyContext . EMPTY , pid ) ; Datastream ds = reader . GetDatastream ( "POLICY" , null ) ; if ( ds != null ) { logger . debug ( "Using POLICY for {}" , pid ) ; return policyParser . parse ( ds . getContentStream ( ) , validate ) ; } else { return null ; } } catch ( ObjectNotInLowlevelStorageException e ) { return null ; } }
the passed parser must be safe to use in this thread