public static String getResourceAsString ( final String resourcePath ) { File resource = getFileForResource ( resourcePath ) ; if ( ! resource . exists ( ) || resource . isDirectory ( ) ) { logger . error ( "Cannot read resource, does not exist" + " (or is a directory)." ) ; return "" ; } try { return FileUtils . readFileToString ( resource ) ; } catch ( IOException ioe ) { logger . error ( ioe . getMessage ( ) ) ; return "" ; } }
Read the resource found at a specific path into a string .