You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Moerk, Detlev" <mo...@konradin.de> on 2006/11/06 12:25:02 UTC
VFS FTP Problem with Text data
Hi,
I tried to use vfs to get some textfiles from a unix host to a windows network drive on a regular basis.
The problem is that the transfer program doesn't take care aobout the different CR (0x0A-->0x0D 0x0A) commands between Unix and Windows
I found that the FTP Conection is alwyas started in FTP.BINARY_FILE_TYPE) that doesn't support the conversion of CR in ftp.
As far as I can see there is no way to change that without changing the source of org.apache.vfs.ftp.FtpClientFactory.
Am I right?
Mit freundlichen Grüßen
Detlev Mörk
Systementwickler
Konradin Business GmbH
Ernst-Mey-Str. 8
70771 Leinfelden-Echterdingen
Tel.: +49 711/7594-504
Fax.: +49 711/7594-1504
Email: detlev.moerk@konradin.de
Re: VFS FTP Problem with Text data
Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi Moerk!
> I tried to use vfs to get some textfiles from a unix host to a windows network drive on a regular basis.
> The problem is that the transfer program doesn't take care aobout the different CR (0x0A-->0x0D 0x0A) commands between Unix and Windows
> I found that the FTP Conection is alwyas started in FTP.BINARY_FILE_TYPE) that doesn't support the conversion of CR in ftp.
>
Eventually it is possible to extend the FtpFileSystemConfigBuilder with
such an option, though, another possibility is to use a BufferedReader
and a PrintWriter to do the conversation on "client side", no?
Simply readline the file and writeln it should do the trick too ... will
work not only with ftp and in conjunction with an InputStreamReader you
can deal with charset conversion at the same time ...
Since the BufferedReader will use a (configureable) buffer to read the
file there should be no huge performance penalty.
What do you think?
Ciao,
Mario
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org