public static InputStream loadInputStream ( final String custConfFileName ) { InputStream is = null ; final File resourceFile = new File ( custConfFileName ) ; // Check if the file could be find if ( resourceFile . exists ( ) ) { try { is = new FileInputStream ( resourceFile ) ; } catch ( final FileNotFoundException e ) { // Nothing to do } } else { // Otherwise try to load from context classloader is = Thread . currentThread ( ) . getContextClassLoader ( ) . getResourceAsStream ( custConfFileName ) ; } return is ; }
TRy to load a custom resource file .