public InputStream newInputStream()

in src/main/java/com/pastdev/jsch/nio/file/UnixSshFileSystemProvider.java [368:388]


    public InputStream newInputStream( Path path, OpenOption... openOptions ) throws IOException {
        UnixSshPath unixPath = checkPath( path ).toAbsolutePath();
        final ChannelExecWrapper channel = unixPath.getFileSystem()
                .getCommandRunner()
                .open( unixPath.getFileSystem().getCommand( "cat" )
                        + " " + unixPath.toAbsolutePath().quotedString() );
        return new InputStream() {
            private InputStream inputStream = channel.getInputStream();

            @Override
            public void close() throws IOException {
                int exitCode = channel.close();
                logger.debug( "cat exited with {}", exitCode );
            }

            @Override
            public int read() throws IOException {
                return inputStream.read();
            }
        };
    }