Java 类org.apache.commons.net.ftp.FTPListParseEngine 实例源码

项目:xdm    文件:FTPClient.java   
private FTPListParseEngine initiateListParsing(FTPFileEntryParser parser, String pathname) throws IOException {
   Socket socket = this._openDataConnection_(26, this.getListArguments(pathname));
   FTPListParseEngine engine = new FTPListParseEngine(parser);
   if(socket == null) {
      return engine;
   } else {
      try {
         engine.readServerList(socket.getInputStream(), this.getControlEncoding());
      } finally {
         Util.closeQuietly(socket);
      }

      this.completePendingCommand();
      return engine;
   }
}
项目:xdm    文件:FTPClient.java   
private FTPListParseEngine initiateMListParsing(String pathname) throws IOException {
   Socket socket = this._openDataConnection_(38, pathname);
   FTPListParseEngine engine = new FTPListParseEngine(MLSxEntryParser.getInstance());
   if(socket == null) {
      return engine;
   } else {
      try {
         engine.readServerList(socket.getInputStream(), this.getControlEncoding());
      } finally {
         Util.closeQuietly(socket);
         this.completePendingCommand();
      }

      return engine;
   }
}
项目:xdm    文件:VMSFTPEntryParser.java   
/** @deprecated */
@Deprecated
public FTPFile[] parseFileList(InputStream listStream) throws IOException {
   FTPListParseEngine engine = new FTPListParseEngine(this);
   engine.readServerList(listStream, (String)null);
   return engine.getFiles();
}
项目:xdm    文件:FTPClient.java   
public FTPListParseEngine initiateListParsing(String parserKey, String pathname) throws IOException {
   if(this.__entryParser == null || !this.__entryParserKey.equals(parserKey)) {
      if(parserKey != null) {
         this.__entryParser = this.__parserFactory.createFileEntryParser(parserKey);
         this.__entryParserKey = parserKey;
      } else if(this.__configuration != null) {
         this.__entryParser = this.__parserFactory.createFileEntryParser(this.__configuration);
         this.__entryParserKey = this.__configuration.getServerSystemKey();
      } else {
         String systemType = System.getProperty("org.apache.commons.net.ftp.systemType");
         if(systemType == null) {
            systemType = this.getSystemType();
            Properties override = getOverrideProperties();
            if(override != null) {
               String newType = override.getProperty(systemType);
               if(newType != null) {
                  systemType = newType;
               }
            }
         }

         this.__entryParser = this.__parserFactory.createFileEntryParser(systemType);
         this.__entryParserKey = systemType;
      }
   }

   return this.initiateListParsing(this.__entryParser, pathname);
}
项目:xdm    文件:FTPClient.java   
public FTPFile[] mlistDir(String pathname) throws IOException {
   FTPListParseEngine engine = this.initiateMListParsing(pathname);
   return engine.getFiles();
}
项目:xdm    文件:FTPClient.java   
public FTPFile[] mlistDir(String pathname, FTPFileFilter filter) throws IOException {
   FTPListParseEngine engine = this.initiateMListParsing(pathname);
   return engine.getFiles(filter);
}
项目:xdm    文件:FTPClient.java   
public FTPFile[] listFiles(String pathname) throws IOException {
   FTPListParseEngine engine = this.initiateListParsing((String)null, pathname);
   return engine.getFiles();
}
项目:xdm    文件:FTPClient.java   
public FTPFile[] listFiles(String pathname, FTPFileFilter filter) throws IOException {
   FTPListParseEngine engine = this.initiateListParsing((String)null, pathname);
   return engine.getFiles(filter);
}
项目:xdm    文件:FTPClient.java   
public FTPListParseEngine initiateListParsing() throws IOException {
   return this.initiateListParsing((String)null);
}
项目:xdm    文件:FTPClient.java   
public FTPListParseEngine initiateListParsing(String pathname) throws IOException {
   return this.initiateListParsing((String)null, pathname);
}
项目:openyu-commons    文件:FtpClientSessionImpl.java   
public FTPListParseEngine initiateListParsing() throws IOException {
    return delegate.initiateListParsing();
}
项目:openyu-commons    文件:FtpClientSessionImpl.java   
public FTPListParseEngine initiateListParsing(String pathname) throws IOException {
    return delegate.initiateListParsing(pathname);
}
项目:openyu-commons    文件:FtpClientSessionImpl.java   
public FTPListParseEngine initiateListParsing(String parserKey, String pathname) throws IOException {
    return delegate.initiateListParsing(parserKey, pathname);
}
项目:openyu-commons    文件:PoolableFtpClient.java   
public FTPListParseEngine initiateListParsing() throws IOException {
    return this.delegate.initiateListParsing();
}
项目:openyu-commons    文件:PoolableFtpClient.java   
public FTPListParseEngine initiateListParsing(String pathname) throws IOException {
    return this.delegate.initiateListParsing(pathname);
}
项目:openyu-commons    文件:PoolableFtpClient.java   
public FTPListParseEngine initiateListParsing(String parserKey, String pathname) throws IOException {
    return this.delegate.initiateListParsing(parserKey, pathname);
}
项目:mojo    文件:FtpHelper.java   
private static boolean commonsGetFolder(FTPClient client, String rFolder, String lFolder) {
    //logger.info("Getting folder " + rFolder + ".");

    // check if client is connected
    if(!client.isConnected()) {
        //logger.error("ftp client was not connected");
        return false;
    }

    try {
        // create local folder
        new File(lFolder).mkdir();

        // move to current folder
        client.changeWorkingDirectory(rFolder);

        // loop through remote folder
        FTPListParseEngine engine = client.initiateListParsing();

        // loop through files
        while(engine.hasNext()) {
            FTPFile[] files = engine.getNext(10);
            for(FTPFile file : files) {
                if(file.isDirectory()) {
                    String childFolder = lFolder + "/" + file.getName();
                    commonsGetFolder(client, childFolder, file.getName());
                } else {
                    String lFilename = lFolder + "/" + file.getName();
                    commonsGetFile(client, lFilename, file.getName());
                }
            }
        }

        // move back to parent folder
        client.changeToParentDirectory();
    } catch(Exception e) {
        //logger.error("Could not upload folder",e);
        return false;
    }
    return true;
}
项目:CadalWorkspace    文件:VFTPFile.java   
public FTPListParseEngine getFTPListParseEngine() {
    return listEngine;
}
项目:CadalWorkspace    文件:VFTPFile.java   
public FTPListParseEngine getFTPListParseEngine() {
    return listEngine;
}
项目:openyu-commons    文件:FtpClientSession.java   
FTPListParseEngine initiateListParsing() throws IOException;
项目:openyu-commons    文件:FtpClientSession.java   
FTPListParseEngine initiateListParsing(String pathname) throws IOException;
项目:openyu-commons    文件:FtpClientSession.java   
FTPListParseEngine initiateListParsing(String parserKey, String pathname) throws IOException;