Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Maciej Opala
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the hint.
I'd consider it strange if it changed anything but will try nevertheless
 
Maciej Opala
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic