commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Muthukumar Arasu" <tmkuma...@hotmail.com>
Subject Re: [Help] FTP of files with non english file names
Date Sat, 18 Feb 2006 18:05:46 GMT

Thanks I got it working. But since my code could be run in any locale I used 
the following method given Sun website

setControlEncoding((new OutputStreamWriter(new 
ByteArrayOutputStream())).getEncoding());

I was trying out the method before, but for some stupid reason I was setting 
the control encoding just before I transferred the files. Then something 
stuck me that the control connection is always present during the lifetime 
and only the data connection is created on the fly. So I moved it to the 
next line after the constructor and it worked fine.

Thanks Daniel.


Kumar

>From: "Daniel F. Savarese" <dfs@savarese.org>
>Reply-To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
>To: commons-user@jakarta.apache.org
>Subject: Re: [Help] FTP of files with non english file names Date: Sat, 18 
>Feb 2006 00:53:50 -0500
>
>
>
>I wrote:
> >So the answer was in the javadocs all along.  I keep telling myself not
>
>The javadocs for setControlEncoding actually specifically answer the
>exact question:
>
>     /**
>      * Sets the character encoding used by the FTP control connection.
>      * Some FTP servers require that commands be issued in a non-ASCII
>      * encoding like UTF-8 so that filenames with multi-byte character
>      * representations (e.g, Big 8) can be specified.
>      *
>      * @param encoding The new character encoding for the control 
>connection.
>      */
>
>daniel
>
>-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-| Sleep and The Traveller 
>|-#-#-#-#-#-#-#-
>     s a v a r e s e      # In distant lands, I hear the call of my home.
>    software research     # Yet my work is not done.  My journey's just 
>begun.
>http://www.savarese.com/ #  -- http://www.sleepandthetraveller.com/
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>



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


Mime
View raw message