Example usage for org.springframework.integration.sftp.session SftpSession list

List of usage examples for org.springframework.integration.sftp.session SftpSession list

Introduction

In this page you can find the example usage for org.springframework.integration.sftp.session SftpSession list.

Prototype

@Override
    public LsEntry[] list(String path) throws IOException 

Source Link

Usage

From source file:com.st.si.Main.java

private static void rename(SftpSession session, String dir) throws IOException {
    for (ChannelSftp.LsEntry entry : session.list(dir)) {
        if (!entry.getFilename().contains(".xml"))
            continue;
        System.out.println(entry.getFilename());
        String from = String.format("%s/%s", dir, entry.getFilename());
        String to = String.format("%s.done", from);
        session.rename(from, to);//  www.  jav a  2  s . c  o  m

    }
}