private String getIntro ( ) { try { InputStream introStream = MyRemoteLibrary . class . getResourceAsStream ( "__intro__.txt" ) ; StringWriter writer = new StringWriter ( ) ; IOUtils . copy ( introStream , writer , Charset . defaultCharset ( ) ) ; return writer . toString ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } }
The introduction is stored in a text file resource because it is easier to edit than String constants .