aspose file tools
The moose likes Beginning Java and the fly likes Loading and saving files Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Loading and saving files" Watch "Loading and saving files" New topic
Author

Loading and saving files

Martin Vietor
Ranch Hand

Joined: Oct 31, 2008
Posts: 40
Hello everyone,

I want to load a file from CD and save it to disk under a different name. I wil have a list or txt-file or somesuch with the file names (which are sorted) and want to copy them and give them names in said order (file1, file2...) so that Windows will be able to put them in the order I like.

Can you shove me in the right direction? I will gladly do the research myself, I don't want to get out of learning it for myself, but a hinter to not waste time would be nice.

Also: How can I tell which drive in a given computer is the DVD-drive? I am writing this for my Dad who knows so painfully little about computers, I want my program to do as much thinking for him as possible.

Thank you,
Martin


The problem people have in trying to create something foolproof is that they generally underestimate the inginuity of fools.
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

With java.io.File you can generate a list of files. Copying files can be done by reading from the old location and writing to the new. If you don't know how then check out this tutorial. With File.listRoots(); you can get the roots but I'm not sure how to figure out if it is a cd drive.


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
 
I agree. Here's the link: jrebel
 
subject: Loading and saving files
 
Similar Threads
Sorting elements of Vectors in multiple ways
How to download the saloon to harddisk
database manipulation
Cd Room Path
What is your favourite "lite" IDE that is free?