- Joined
- Jun 30, 2008
- Messages
- 1,145 (0.19/day)
- Location
- England
System Name | Wasleys PC |
---|---|
Processor | Intel i5 2400 3.10GHz |
Motherboard | Asus P8z68-V |
Cooling | AC Freezer Pro |
Memory | Kingston 4GB (2x2GB) DDR3 Hyperx Memory |
Video Card(s) | HIS ATi 6850 1GB DDR3 |
Storage | Seagate ST3500320AS 500GB Hard Drive SATA II 7200rpm *32MB Cache* |
Case | Antec 900 with mods |
Audio Device(s) | On Board |
Power Supply | OCZ Stealth Xtream 500W |
Software | Windows 7 |
Can anyone tell me what I've done wrong with the following code. I receive no errors - it just goes straight to the catch.
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class Main {
public static void main(String[] args) {
Path source = Paths.get("C:\\Users\\Public\\Pictures\\SamplePictures");
Path nwdir = Paths.get("D:\\NetbeansProjects\\CopyingFiles\\copiedImages");
try{
Files.copy(source, nwdir);
}catch (IOException e){
System.out.println("Unsucessful. What a surprise!");
}
}
}