I want to connect through FTP to a Mainframe server. I can't do a direct FTP using prebuilt java libraries. I can open a command prompt and then do the actions though. I tried to automate this and get a java function do this for me. So I created a cmd window in java and connected to the FTP. I am not sure how we can pass the username and password to it.
This is my code for now :
public class CMDWindow {
public static void main(String[] args) throws IOException {
Runtime rt = Runtime.getRuntime();
rt.exec("cmd.exe /c start ftp *ip*");
}
}
And below is what my cmd displays:
Connected to *ip*.
Username:
How can I pass the username and password to it using java?