第1个回答 2012-07-17
public static void buildList(FtpClient aftp,String pathList) throws Exception {
aftp.ascii();
StringTokenizer s = new StringTokenizer(pathList, "/"); //sign
int count = s.countTokens();
String pathName = "";
while (s.hasMoreElements()) {
pathName = pathName + "/" + (String) s.nextElement();
try {
aftp.sendServer("XMKD " + pathName + "\r\n"); }
catch (Exception e) { e.printStackTrace(); }
int reply = aftp.readServerResponse(); }
aftp.binary();
}