目前,我的系统通过FTP将文件从AS400发送到大型机。下游大型机系统将不再支持FTP。 FTPS将是向其发送文件的唯一方式。
目前我们使用com.ibm.as400.access.FTP
和此包来执行FTP命令。我想知道FTPS从AS400到Mainframe可以使用什么包。
目前ftp代码如下:
boolean FTPFile(String filepath, String filename, String country) {
String ftpresult = "";
String region = bundle.getString("region." + country);
FTP ftp = new FTP(ftpHost, ftpId, ftpPw);
try {
if (country.equals("766") || country.equals("858")
|| country.equals("761") || country.equals("836")) {
ftp.setDataTransferType(FTP.BINARY);
}
if (ftp.connect()) {
getLogMsg().append("FTPing SIF file. Region = " + region,
LogMsg.TEXT_MSG);
String sendname = "'" + ftpDataset + country + ".LSIFATB'";
getLogMsg().append(
"sending file: = " + filepath + filename + " as "
+ sendname, LogMsg.TEXT_MSG);
// Korea
if (country.equals("766") || country.equals("761")) {
ftp.issueCommand("ltype c 933");
// ftpresult = ftp.issueCommand("type b 6");
}
// Taiwan
if (country.equals("858") || country.equals("836")) {
ftp.issueCommand("ltype c 937");
// ftpresult = ftp.issueCommand("type b 8");
}
boolean ftp_res = ftp.put(filepath + filename, sendname);
// System.out.println("ftp result: " + ftp_res);
getLogMsg().append("ftp result (sending SIF): " + ftp_res,
LogMsg.TEXT_MSG);
ftpresult = ftp.issueCommand("site filetype=jes");
System.out.println("ftp command result = " + ftpresult);
String jobname = bundle.getString("app.sif.jobname." + country);
// String jobname = "CISBL30D";
ftp.setDataTransferType(FTP.ASCII);
ftp_res = ftp.put(bundle.getString("app.sif.directory") + "/"
+ region + country + "/jcl.txt", "jcl.txt '" + jobname
+ "'");
getLogMsg().append("ftp result (sending jcl): " + ftp_res,
LogMsg.TEXT_MSG);
return true;
}
} catch(...) {}
}