public InputStream open ( String filename ) throws IOException { if ( STDIN_AS_SOURCE . equals ( filename ) ) { return System . in ; } URI uri = qualifiedURI ( filename ) ; if ( RESOURCE_URI_SCHEME . equals ( uri . getScheme ( ) ) ) { return Resources . getResource ( uri . getRawSchemeSpecificPart ( ) ) . openStream ( ) ; } else { Path filePath = new Path ( uri ) ; // even though it was qualified using the default FS, it may not be in it FileSystem fs = filePath . getFileSystem ( getConf ( ) ) ; return fs . open ( filePath ) ; } }
Opens an existing file or resource .