commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Venkat Guru <venkataguru.mi...@valuelabs.net>
Subject Apache Commons FTPClient not wokring in Red Hat Linux
Date Fri, 13 Jun 2008 06:29:35 GMT

Hi friends,

Iam using apache commons FTPClient (In "commons-net-1.4.1.jar" ). Iam using
it to read files and write a file onto a FTP server.

This class works fine in Windows environment, but its not working on linux (
red hat linux) environment. The following snippet code is for reading a file
on FTP. This piece of code results to deadlock situation at bolded code.



FTPClient ftpclient = new FTPClient();
ByteArrayOutputStream baos = null;
ByteArrayInputStream bais = null;
try {
ftpclient.connect(ftpLocation.trim());
// check reply code.
if (!FTPReply.isPositiveCompletion(ftpclient.getReplyCode())) {
ftpclient.disconnect();
;
return null;
} else {
System.out.println("IN Positive Connection made; Reply code = "
+ ftpclient.getReplyCode());
}

ftpclient.login(ftpUserId.trim(), ftpPwd.trim());
ftpclient.changeWorkingDirectory(strConfigDirectory.trim());

baos = new ByteArrayOutputStream();
ftpclient.retrieveFile(strConfigFileName.trim(), baos);
bais = new ByteArrayInputStream(baos.toByteArray());

ftpclient.logout();
ftpclient.disconnect();
} catch (IOException e) {
e.getMessage();
} catch (Exception e) {
e.getMessage();
}


---------------------
Hi friends, did anyone face this kind of problem. Please provide me a
solution to this. Iam in urgene need.

Thanks in advance,
Venkat
-- 
View this message in context: http://www.nabble.com/Apache-Commons-FTPClient-not-wokring-in-Red-Hat-Linux-tp17815974p17815974.html
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message