@ Deprecated public static String getResourceAsString ( String resourceFile , Class clazz ) { Assert . notNullOrEmptyTrimmed ( resourceFile , "Missing resource file!" ) ; Scanner scanner = null ; try { InputStream resource = clazz . getResourceAsStream ( resourceFile ) ; scanner = new Scanner ( resource , UTF_8 ) ; return scanner . useDelimiter ( "\\A" ) . next ( ) ; } catch ( Exception e ) { return null ; } finally { if ( scanner != null ) { scanner . close ( ) ; } } }
Loads class resource to String