private static List < ExampleQuery > loadExamplesFromRemote ( Set < String > corpusNames ) { List < ExampleQuery > result = new LinkedList <> ( ) ; WebResource service = Helper . getAnnisWebResource ( ) ; try { if ( corpusNames == null || corpusNames . isEmpty ( ) ) { result = service . path ( "query" ) . path ( "corpora" ) . path ( "example-queries" ) . get ( new GenericType < List < ExampleQuery > > ( ) { } ) ; } else { String concatedCorpusNames = StringUtils . join ( corpusNames , "," ) ; result = service . path ( "query" ) . path ( "corpora" ) . path ( "example-queries" ) . queryParam ( "corpora" , concatedCorpusNames ) . get ( new GenericType < List < ExampleQuery > > ( ) { } ) ; } } catch ( UniformInterfaceException ex ) { // ignore } catch ( ClientHandlerException ex ) { log . error ( "problems with getting example queries from remote for {}" , corpusNames , ex ) ; } return result ; }
Loads the available example queries for a specific corpus .