我需要在spring integration中使用FTP从服务器获取文件名,有人能给出解决方案吗?

我需要在spring integration中使用FTP从服务器获取文件名,有人能给出解决方案吗?,ftp,spring-integration,Ftp,Spring Integration,如何从服务器获取文件名,我需要检查服务器文件夹中显示的所有文件是什么,RemoteFileTemplate是为您提供的: /** * List the files at the remote path. * @param path the path. * @return the list. */ F[] list(String path); 对于FTP,它将委托给org.apache.commons.net.FTP.FTPClient.listFiles() 虽然是,但您可以直接使用该

如何从服务器获取文件名,我需要检查服务器文件夹中显示的所有文件是什么,
RemoteFileTemplate
是为您提供的:

/**
 * List the files at the remote path.
 * @param path the path.
 * @return the list.
 */
F[] list(String path);
对于FTP,它将委托给
org.apache.commons.net.FTP.FTPClient.listFiles()

虽然是,但您可以直接使用该
FTPClient
进行此类操作


您还可以尝试
DefaultFtpSessionFactory
getSession()。listNames(path)
远程文件模板适用于您:

/**
 * List the files at the remote path.
 * @param path the path.
 * @return the list.
 */
F[] list(String path);
对于FTP,它将委托给
org.apache.commons.net.FTP.FTPClient.listFiles()

虽然是,但您可以直接使用该
FTPClient
进行此类操作


您还可以尝试
DefaultFtpSessionFactory
getSession()。listNames(path)

有一个子类
FtpRemoteFileTemplate
。您还可以使用with
ls
命令。有一个子类
FtpRemoteFileTemplate
。您还可以使用with
ls
命令。