• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Problem with reading file from disk into XML

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to read some files from disk, as XML, then make a string of each of them and [using a queue to keep all the strings ] send via HTTP to the client per it's request.
If I use apache-commons-io.FileUtils.fileAsString - I get some characters not ending up the same in the result, so it looks like encoding problem which I don't know how to solve.

If I use XMLEventReader/Writer so as to treat the file as xml, read it by events etc, and then make a string out of it, then queue ets, the client can't read the XML at all ...

Please help -as this does feel like voodoo right now ..

Problem solved -indeed encoding issue, which is easy as pie to handle in FileUtils -just provided the relevant encoding as param to the method.
 
This. Exactly this. This is what my therapist has been talking about. And now with a tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic