Please
UseCodeTags . It will make your code much easier to read. I can't see what might be wrong though. It would help if you also posted what was not working about it, whether that's a thrown exception, or just no output.
I had actually never heard of the Path class, but with a little research I found that it's being introduced to the java.nio.file package in
Java 7. That unfortunately means you can't use it in Java 6.