protected InputStream getLocalFileInputStream ( String path , String dataType , TestContext context ) throws IOException { if ( dataType . equals ( DataType . ASCII . name ( ) ) ) { String content = context . replaceDynamicContentInString ( FileUtils . readToString ( FileUtils . getFileResource ( path ) ) ) ; return new ByteArrayInputStream ( content . getBytes ( FileUtils . getDefaultCharset ( ) ) ) ; } else { return FileUtils . getFileResource ( path ) . getInputStream ( ) ; } }
Constructs local file input stream . When using ASCII data type the test variable replacement is activated otherwise plain byte stream is used .