private String getJavaScriptAsString ( ) { InputStream fis = getClass ( ) . getResourceAsStream ( "RobotiumWeb.js" ) ; StringBuffer javaScript = new StringBuffer ( ) ; try { BufferedReader input = new BufferedReader ( new InputStreamReader ( fis ) ) ; String line = null ; while ( ( line = input . readLine ( ) ) != null ) { javaScript . append ( line ) ; javaScript . append ( "\n" ) ; } input . close ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } return javaScript . toString ( ) ; }
Returns the JavaScript file RobotiumWeb . js as a String