I want to send ftp or telnet commands on the Unix command box. I want to connect to say ftp enter user name and password and then run "ls" command
Here is what I have written so far, code to ftp.
But when I run the program I do not know what has happened? How can I do the next stage like enter "user name" "password" and finally run "ls" command for unix?????????
I have done my own search on the web but I think I am not a good searcher on the search engine.
I would be greatful for any more more links on ftp or telnet java program with source code, preferably one with easy to understand code.
Thanks in advance.
09-17-2002, 03:38 PM
I want to integrate an ftp program into a program I am working on. I have scoured the net for reusebale code and come across a "t or Linlyn ftp program" which claims is easily integrateable into larger applications. The code is quite small so easy to understand.
The problem is did does not seem to work and gives me errors. I would be grateful if someone could tell me why I am getting the error, here is the error:
C:\My_DL_Dap\ftp in java>appletviewer t.java
Warning: <applet> tag requires width attribute.
java.security.AccessControlException: access denied (java.net.SocketPermission j
I would also be grateful if someone could try out the propgram and tell me if it works for them, then I could determine if it is because ftp clients are being blocked by my server. The ftp program is very small, here is the url:
1) compile the code
2) fill in everywhere it requests "your-server" "username" and "password"
3) to run appletviewer t.java
09-18-2002, 06:23 AM
this is more of a question than solution. I have no experience on this but my doubt is based on my general knowledge of Java and networking. In your code you are calling an external program called ftp.exe and executing it. If my understanding of your requirement is correct then then why do you need this (any advantage?) i.e. call an external FTP program when you can create a socket directly to your FTP host on port 21 for FTP connection and work out suitable code to handle "username" & "password".
When you run an external program (ftp.exe) then you have to pass on arguments (FTP host address,username,password) to this program and not to the host directly because your java code is not requesting a connection to the FTP host.