commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sundararajan Govindarajan" <>
Subject Problem while trying to write multiple files using FTPClient
Date Mon, 13 Oct 2003 18:39:50 GMT
Iam trying to write two files as part of my transaction into a ftp server. I dont have the
physical file in my local system and i only have the contents. So iam opening a connection
stream to the ftp server using the method ftpClient.storeFile (remotefilename). I am successful
in opening the first outputstream but my program hangs when it tries to open the second outputstream.
This is the code iam using,

		String txnFileName = "txn1";
		String txnIsDoneFile = "txn1.ISDONE";
		String keywordContents = "Transcation contents";
		String isDoneContents = "ISDONE contents";
		try {
			OutputStream firstOutputStream = ftpClient.storeFileStream (txnFileName);
			OutputStream secondOutputStream = ftpClient.storeFileStream(txnIsDoneFile);

			DataOutputStream firstDataOutputStream = new DataOutputStream (firstOutputStream);
			firstDataOutputStream.writeBytes (keywordContents);

			DataOutputStream secondDataOutputStream = new DataOutputStream (secondOutputStream);
		catch (Exception exp){

I tried to open the second ouputstream after closing the first ouputstream. It always returned
a null in that case.

any help in this regard will be greatly appreciated.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message