Closed SkytAsul closed 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.
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.