tchristofferson / Config-Updater

Used to update files for Bukkit/Spigot API
MIT License
66 stars 9 forks source link

Do not write file if contents have not changed #10

Closed SkytAsul closed 2 years ago

SkytAsul commented 2 years ago

Currently, any call of ConfigUpdater#update will write the new file with the computed contents. However, writting the file to the disk is NOT necessary if the "new" and "current" contents are the same. This commit changes this, by writting "updated contents" to a string first and then to the file if it detects any change.

SkytAsul commented 2 years ago

I agree that I should only write to the file if there are changes. However, the code you used is Java 11 and needs to be Java 8. Many people unfortunately use java 8.

I thought those basic operations where apart of Java 8 nio API ^^' this is now fixed.