Example usage for org.apache.commons.net.ftp FTPFile isSymbolicLink

List of usage examples for org.apache.commons.net.ftp FTPFile isSymbolicLink

Introduction

In this page you can find the example usage for org.apache.commons.net.ftp FTPFile isSymbolicLink.

Prototype

public boolean isSymbolicLink() 

Source Link

Document

Determine if the file is a symbolic link.

Usage

From source file:org.punksearch.crawler.adapters.FtpAdapterTest.java

private FTPFile getSomeFile() {
    try {//  ww w .  j a  v a2  s .  com
        FTPFile[] items = ftp.listFiles(rootPath);
        for (FTPFile item : items) {
            if (item.isDirectory() && !item.getName().startsWith(".")) {
                FTPFile[] items2 = ftp.listFiles(item.getName());
                if (items2 == null) {
                    continue;
                }
                ftp.changeWorkingDirectory(rootPath + item.getName());
                for (FTPFile item2 : items2) {
                    if (!item2.isDirectory() && !item2.isSymbolicLink() && !item2.getName().startsWith(".")
                            && item2.getName().contains(".")) {
                        return item2;
                    }
                }
            }
        }
        return null;
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}

From source file:org.springframework.integration.ftp.gateway.FtpOutboundGateway.java

@Override
protected boolean isLink(FTPFile file) {
    return file.isSymbolicLink();
}