Fixed a bug which prevented full license files to be written properly.
authorMarco Zanon <info@marcozanon.com>
Sat, 2 Mar 2024 17:02:54 +0000 (17:02 +0000)
committerMarco Zanon <info@marcozanon.com>
Sat, 2 Mar 2024 17:02:54 +0000 (17:02 +0000)
CHANGELOG
src/main/java/com/marcozanon/macaco/licensing/MLicenseManager.java

index 9ff8ba1a30cc293cc85f051e8e90d0548df3537f..847a834b8560f70042a1ad0e144eae1cee2c1bbd 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,11 @@ Macaco
 Copyright (c) 2009-2024 Marco Zanon <info@marcozanon.com>.
 See LICENSE for details.
 
+------------------
+9.2.1 (2024-03-02)
+------------------
+* Fixed a bug which prevented full license files to be written properly.
+
 ------------------
 9.2.0 (2024-02-29)
 ------------------
index f90fe0799ec018d95bd3386e62ae874d7f4750a0..8020158e8278b70f0c6dfa5e5e0e91e754b09105 100644 (file)
@@ -38,7 +38,7 @@ public class MLicenseManager {
             //
             MJsonObject fullLicense = MLicenseManager.generateFullLicense(privateKeyPemString, licenseSkeletonJsonString);
             //
-            Files.write(fullLicenseFile, fullLicense.getJsonValue(true).getBytes(MConstants.DEFAULT_CHARSET), StandardOpenOption.CREATE);
+            Files.write(fullLicenseFile, fullLicense.getJsonValue(true).getBytes(MConstants.DEFAULT_CHARSET), StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING);
         }
         catch (IOException exception) {
             throw new MLicensingException("Could not generate full license.", exception);