Example usage for org.springframework.integration.file.remote InputStreamCallback doWithInputStream

List of usage examples for org.springframework.integration.file.remote InputStreamCallback doWithInputStream

Introduction

In this page you can find the example usage for org.springframework.integration.file.remote InputStreamCallback doWithInputStream.

Prototype

void doWithInputStream(InputStream stream) throws IOException;

Source Link

Document

Called with the InputStream for the remote file.

Usage

From source file:org.springframework.integration.file.remote.RemoteFileTemplate.java

@Override
public boolean get(final String remotePath, final InputStreamCallback callback) {
    Assert.notNull(remotePath, "'remotePath' cannot be null");
    return this.execute(session -> {
        InputStream inputStream = session.readRaw(remotePath);
        callback.doWithInputStream(inputStream);
        inputStream.close();/*from  ww  w.ja v  a 2  s .c  o  m*/
        return session.finalizeRaw();
    });
}