Meaningless Drivel is fun!*
The moose likes Linux / UNIX and the fly likes FTP'ing files into a UNIX machine using JAVA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "FTP Watch "FTP New topic

FTP'ing files into a UNIX machine using JAVA

Ravi Pydi

Joined: Sep 01, 2002
Posts: 25
I am trying to FTP a text file from a AIX box to a UNIX box using JAVA. I already have a code which can FTP files into a Windows environment. I am using the same code to log into the Solaris box. I am able to log into the system by using the doCommand() method (see code below) but the same code isn't working in the ftp session. I am getting "Get option: single" as a response when I execute any command after logging in. But the same doCommand() method after logging in works fine on a windows box.

The method that is trying to execute the commands on the UNIX server is as follows:

public String doCommand(String commandString)
throws IOException
String response = getResponse();
System.out.println("The response from the Mailbox server is : " + response);
return response;

Any suggestions on this is greatly appreciated.

Ravi Pydi
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15964

There are Java packages out there in that can send and receive files from FTP servers without you having to reinvent the entire FTP protocol.

Try Google.

Customer surveys are for companies who didn't pay proper attention to begin with.
I agree. Here's the link:
subject: FTP'ing files into a UNIX machine using JAVA
Similar Threads
ANT FTP task: Software caused connection abort: connect
What do i need to do connection refused connect
invoking a browser from application
SFTP from java
FTP'ing files onto a UNIX machine using JAVA