public DokumentRs retrieveContent( UserContext userContext, String id ) {
try {
InputStream inputStream = serviceDelegate.retrieveContent( id, JuridiskEnhetFactory.create( userContext ) );
InputStreamDataSource dataSource = new InputStreamDataSource( inputStream, "application/pdf", id );
DataHandler dataHandler = new DataHandler( dataSource );
DokumentRs rs = new DokumentRs();
rs.setFilnavn( id );
rs.setData( dataHandler );
return rs;
} catch (Exception e) {
throw ServiceDelegateImpl.handleException( e );
}
}