Migrate to java.nio for file handeling