Class ScaffoldLockfileIo
java.lang.Object
network.ike.plugin.scaffold.ScaffoldLockfileIo
Read and write
ScaffoldLockfile instances in the on-disk
YAML format documented in the
dev-ike-scaffold-architecture design note.
Uses SnakeYAML for parsing; emits a stable, human-friendly
representation via block
style with insertion-order preserved. The writer writes the
schema version first, then the top-level stamps, then the
files: map — so a hand-read diff of
.ike/scaffold.lock stays easy to follow across publishes.
All emitted timestamps are in UTC ISO-8601 ("Z").
-
Method Summary
Modifier and TypeMethodDescriptionstatic ScaffoldLockfileParse a lockfile from a Reader.static ScaffoldLockfileParse a lockfile from a file path.static voidwrite(ScaffoldLockfile lockfile, Writer writer) Serialise a lockfile through anyWriter.static voidwrite(ScaffoldLockfile lockfile, Path path) Serialise a lockfile to a file path, creating parent directories if needed.static StringwriteToString(ScaffoldLockfile lockfile) Serialise a lockfile to YAML text.
-
Method Details
-
read
Parse a lockfile from a file path.- Parameters:
path- path to the YAML lockfile- Returns:
- the parsed lockfile
- Throws:
ScaffoldException- if the file cannot be read, is empty, or has an unsupported schema version
-
read
Parse a lockfile from a Reader.- Parameters:
reader- source of YAML text- Returns:
- the parsed lockfile
- Throws:
ScaffoldException- if the YAML is empty or has an unsupported schema version
-
writeToString
Serialise a lockfile to YAML text. Does not touch disk.- Parameters:
lockfile- the lockfile to serialise- Returns:
- its YAML representation
-
write
Serialise a lockfile to a file path, creating parent directories if needed.- Parameters:
lockfile- the lockfile to serialisepath- destination path- Throws:
ScaffoldException- if the file cannot be written
-
write
Serialise a lockfile through anyWriter.- Parameters:
lockfile- the lockfile to serialisewriter- destination writer (not closed)
-