Add license header. [0]
Using Java 7+ Path classes. [1423]

java.nio.file.Files, java.nio.file.Path, and java.nio.file.Paths make
working with files a lot less clunky.
Java 7+ try-with-resources example. [1423]

Try-with-resources is just a way to have Java automatically ensure that
a file (or “resource”) is closed after being used.

Also did a bit of cleanup.