aspose file tools
The moose likes I/O and Streams and the fly likes encoding [?] problem - different content on Win and Linux after downloading file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Reply Bookmark "encoding [?] problem - different content on Win and Linux after downloading file" Watch "encoding [?] problem - different content on Win and Linux after downloading file" New topic
Author

encoding [?] problem - different content on Win and Linux after downloading file

Maciej Opala
Greenhorn

Joined: Jul 18, 2011
Posts: 23
Hi,
Don't know where to write but guess it might be the best forum.
I've written small command line tool in groovy to download/upload file to drools.
When I download file I receive different content on linux and win just after converting the stream to string (before saving file to local filesystem).

Linux:


Win:


Here's the code:

I use HttpComponents to handle net tasks. Does anybody know the explanation? I'm really annoyed with this problem and run out of possible solutions.
Alex Armenteros
Ranch Hand

Joined: May 05, 2010
Posts: 46
I see this is not java but I encountered a similar problem last week.

be careful what programs do you use to transfer between SOs, WinSCP change the size of text files.

Also that way the file was read differently on Win than on Linux.

Finally I got it reading the file byte by byte.



Maciej Opala
Greenhorn

Joined: Jul 18, 2011
Posts: 23
Thanks for the hint.
I'd consider it strange if it changed anything but will try nevertheless
Maciej Opala
Greenhorn

Joined: Jul 18, 2011
Posts: 23
Have done it as You advised Alex Armenteros. Thanks for the solution! But it's strange that Apache IOUtils couldn't handle these stream operations correctly. Or I don't know how to use it.
 
 
subject: encoding [?] problem - different content on Win and Linux after downloading file
 
Threads others viewed
webresponse from httpunit to download
JBoss with EJB
download an attachment with httpunit webresponse
curl "not recognized as internal or external command"
I am connecting liferay communtiy edition 6.0.6 with postgresql 9.1 and using apache tomcat server6.
IntelliJ Java IDE