类 FtpClientHelper


  • public class FtpClientHelper
    extends Object
    • 构造器详细资料

      • FtpClientHelper

        public FtpClientHelper()
    • 方法详细资料

      • deleteFile

        public boolean deleteFile​(String pathname)
                           throws Exception
        删除文件 单个 ,不可递归
        参数:
        pathname - 带路径的文件名称
        返回:
        boolean 删除状态
        抛出:
        Exception - error occurs.
      • makeDirectories

        public boolean makeDirectories​(org.apache.commons.net.ftp.FTPClient client,
                                       String dirPath)
                                throws Exception
        Creates a nested directory structure on a FTP server
        参数:
        client - object instance from the pool
        dirPath - Path of the directory, i.e /projects/java/ftp/demo
        返回:
        boolean true if the directory was created successfully, false otherwise
        抛出:
        Exception - – error occurs.
      • makeDirectory

        public boolean makeDirectory​(org.apache.commons.net.ftp.FTPClient client,
                                     String pathname)
                              throws Exception
        创建目录 单个不可递归
        参数:
        client - object instance from the pool
        pathname - 目录名称
        返回:
        boolean true if the directory was created successfully, false otherwise
        抛出:
        Exception - error occurs.
      • removeDirectory

        public boolean removeDirectory​(String pathname)
                                throws Exception
        删除目录,单个不可递归
        参数:
        pathname - 目录名称
        返回:
        boolean true if the File is remove successfully, false otherwise
        抛出:
        IOException - error occurs.
        Exception
      • retrieveFileBytes

        public byte[] retrieveFileBytes​(String remote)
                                 throws Exception
        下载remote文件字节
        参数:
        remote - 远程文件
        返回:
        字节数据
        抛出:
        Exception - error occurs.
      • setFtpClientPool

        public void setFtpClientPool​(FtpClientPool ftpClientPool)
      • storeFile

        public boolean storeFile​(String fullPath,
                                 String realFileName,
                                 InputStream local)
                          throws Exception
        上传文件
        参数:
        fullPath - 路径
        realFileName - 真实文件名称
        local - 文件流
        返回:
        boolean true if the File was upload successfully, false otherwise
        抛出:
        Exception - error occurs.