protected ArrayList < String > getLabels ( String textResource ) throws IOException { ArrayList < String > labels = new ArrayList <> ( ) ; File resourceFile = getResourceFile ( ) ; //Download if required try ( InputStream is = new BufferedInputStream ( new FileInputStream ( resourceFile ) ) ; Scanner s = new Scanner ( is ) ) { while ( s . hasNextLine ( ) ) { labels . add ( s . nextLine ( ) ) ; } } return labels ; }
Returns labels based on the text file resource .