Examples of FTPFileFilter


Examples of org.apache.commons.net.ftp.FTPFileFilter

   * 列出当前目录下的所有文件(目录除外)
   * @param fileExt
   * @return
   */
  public String[] listFiles(String fileExt) {
    FTPFileFilter filter = null;
    if (fileExt != null) {
      final String suffix = "." + fileExt;
      filter = new FTPFileFilter(){
        @Override
        public boolean accept(FTPFile file) {
          if (! file.isFile()) return false;
          return file.getName().endsWith(suffix);
        }
View Full Code Here

Examples of org.apache.commons.net.ftp.FTPFileFilter

   * 列出当前目录下的所有子目录
   * @param fileExt
   * @return
   */
  public String[] listDirectories() {
    FTPFileFilter filter = new FTPFileFilter(){
      @Override
      public boolean accept(FTPFile file) {
        return file.isDirectory();
      }
    };
View Full Code Here

Examples of org.apache.commons.net.ftp.FTPFileFilter

   
    try {
      if (! ftpClient.changeWorkingDirectory(ftpPath))
        throw new RuntimeException("Cann't ftpClient.changeWorkingDirectory('"+ ftpPath +"').");
     
      FTPFileFilter filter = null;
      if (fileExt != null) {
        final String suffix = "." + fileExt;
        filter = new FTPFileFilter(){
          @Override
          public boolean accept(FTPFile file) {
            if (! file.isFile()) return false;
            return file.getName().endsWith(suffix);
          }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.