• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Write File to Harddrive

 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Guys;

I read in a file as follows;


Also i want to write the file back out to a new location;

I have that so far, but dont know what kind of format variable BufferedWriter wants, it wont accept ArrayList line and i cant put ArrayList lines into a file; Also how do i specify where to write the file on my harddrive and what to call it.
Thanks
Mark
 
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This way, comrade



I must add also that Jakarta Commons IO offers some IO utilities which do all that you want easier.

For instance, as simple as this:



Besides methods like copyFile(File srcFile, File destFile). Also, the IOUtils class have methods to copy files from one InputStream into an OutputStream or a Reader into a Writer or combinations of them.

Take a look at it.

I hope that helps!
[ July 27, 2006: Message edited by: Edwin Dalorzo ]
 
Mark Hughes
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, helps alot
 
reply
    Bookmark Topic Watch Topic
  • New Topic