private static InputStream inputStreamFromFile ( String relativePathPrefix , String src ) throws IOException { File file = getFile ( relativePathPrefix , src ) ; if ( ! file . exists ( ) ) { if ( src . length ( ) > 0 && src . charAt ( 0 ) == File . separatorChar ) { file = getFile ( relativePathPrefix , src . substring ( 1 ) ) ; } if ( ! file . exists ( ) ) { file = null ; } } else if ( ! file . isFile ( ) || ! file . canRead ( ) ) { file = null ; } if ( file != null ) { return new FileInputStream ( file ) ; } return null ; }
Create InputStream from file resource .