Updated to use java.nio to write files, use a more generic name for
configuring file path as suggested.