比如String dirName="/newDir"
File dir=new File(dirName)
if(!dir.exists())
dir.mkdir()
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()
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)