Class StrictYamlPublication
java.lang.Object
com.ultikits.ultitools.config.document.StrictYamlPublication
Complete publication only, selected solely by the opt-in YAML gate. Never opens the final target for writing.
All uses are under WRITE_LOAD_LOCK. No scanning/recovery or inference of prior temporary ownership is performed.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classA changed/deleted file or an existing creation target is not permission to write it.private static final classprivate static final classA close failure remains pre-commit; try-with-resources preserves an earlier failure as primary.(package private) static interface(package private) static final classPolicy refusal, distinguished from an I/O failure and reported once by the gate without values.(package private) static final classThe path/kind preflight; publication restrictions are checked only once a real edit needs staging. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StrictYamlPublication.Targetprivate Object(package private) static final AtomicReference<StrictYamlPublication.Operations> Filesystem seam, captured once per invocation; null selects real operations.private static final Loggerprivate static final Set<PosixFilePermission> private static final Set<PosixFilePermission> private static final StrictYamlPublication.Operationsprivate final Path -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateStrictYamlPublication(StrictYamlPublication.Target destination, Path temporary) -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidcheckKind(Path file, boolean creating, StrictYamlPublication.Operations files) (package private) voidcommit()Successful atomic move is the replacement commit point; never retry with weaker semantics.(package private) voidNative POSIX link's new-entry operation, not ATOMIC_MOVE used as create-if-absent.(package private) booleanCleanup requires current regular-file kind and the same non-null key recorded at exclusive creation.(package private) booleanThe gate checks this before reading current bytes, immediately before publication.(package private) static StrictYamlPublication.TargetAnchors only the real parent, never lexically normalizing away a symlink followed by '..'.private static PosixFileAttributesrequirePosix(Path path, StrictYamlPublication.Operations files) private voidprivate static voidsuppressCleanupFailure(Throwable primary, Throwable failure) Throwable.addSuppressed rejects self-suppression by identity, not by an overridable equals implementation.private voidBest effort only after commit: never imply that committed content was not published.
-
Field Details
-
FILES
Filesystem seam, captured once per invocation; null selects real operations. -
REAL
-
LOGGER
-
WARNED_SYNC
-
PRIVATE
-
NONE
-
destination
-
temporary
-
fileKey
-
-
Constructor Details
-
StrictYamlPublication
-
-
Method Details
-
prepare
Anchors only the real parent, never lexically normalizing away a symlink followed by '..'.- Throws:
IOException
-
checkKind
private static void checkKind(Path file, boolean creating, StrictYamlPublication.Operations files) throws IOException - Throws:
IOException
-
requirePosix
private static PosixFileAttributes requirePosix(Path path, StrictYamlPublication.Operations files) throws IOException - Throws:
IOException
-
matchesTarget
The gate checks this before reading current bytes, immediately before publication.- Throws:
IOException
-
commit
Successful atomic move is the replacement commit point; never retry with weaker semantics.- Throws:
IOException
-
commitAsNewFile
Native POSIX link's new-entry operation, not ATOMIC_MOVE used as create-if-absent.- Throws:
IOException
-
syncDirectory
private void syncDirectory()Best effort only after commit: never imply that committed content was not published. -
discard
Cleanup requires current regular-file kind and the same non-null key recorded at exclusive creation. -
suppressCleanupFailure
Throwable.addSuppressed rejects self-suppression by identity, not by an overridable equals implementation. -
retained
-