Class CommonUtils
- Since:
- 6.0.0
- Author:
- wisdomme
-
Constructor Details
-
CommonUtils
public CommonUtils()
-
-
Method Details
-
getUltiToolsUUID
get UltiTools UUIDReads the current UUID without writing to the credential store when one already exists -- only the first-ever call (or a rare concurrent race against another first-ever call) needs to write. WR-01 (08-REVIEW.md): the previous unconditional
CredentialStore.update(java.util.function.UnaryOperator<java.util.Map<java.lang.String, java.lang.Object>>)call rewrote the live-credential file on every invocation, including the common already-exists case, which needlessly widened the write window on the single-owner store.A credential file that exists but is empty, whitespace-only or not valid JSON is never replaced by a fresh identity (#573): this method fails with an
IOExceptionthat names the file and leaves it untouched. Only a missing file starts a new UUID. Every failure of the credential store is reported as this method's declaredIOException, never as an unchecked exception, so a caller'scatch (IOException e)covers it.- Returns:
- UUID
- Throws:
IOException- if the credential file cannot be read or written, or exists but cannot be read as a credential document
-
readOrCreateUuid
- Throws:
IOException
-