public static void ensureContentType ( CDAEntry entry , CDAClient client ) { CDAContentType contentType = entry . contentType ( ) ; if ( contentType != null ) { return ; } String contentTypeId = extractNested ( entry . attrs ( ) , "contentType" , "sys" , "id" ) ; try { contentType = client . cacheTypeWithId ( contentTypeId ) . blockingFirst ( ) ; } catch ( CDAResourceNotFoundException e ) { throw new CDAContentTypeNotFoundException ( entry . id ( ) , CDAEntry . class , contentTypeId , e ) ; } entry . setContentType ( contentType ) ; }
Make sure that the given entry has a filled in content type .