Package com.kamikazejam.kamicommon.yaml.source
package com.kamikazejam.kamicommon.yaml.source
-
ClassDescriptionRepresents a source of configuration data that can provide an
InputStreamfor reading
and may optionally support writing/persistence.
Typical implementations:
- File-backed source (writable)
- Provider/remote/in-memory source (read-only)
Contract notes:
- Each call toConfigSource.openStream()should return a fresh stream positioned at the start.
- IfConfigSource.isWritable()is false,ConfigSource.write(byte[], Charset)must throwUnsupportedOperationException.
-ConfigSource.ensureExistsIfWritable()should create any required backing structures for writable sources.
-ConfigSource.asFileIfPresent()returns aFileonly for file-backed sources; otherwise null.AConfigSourceimplementation that reads from and writes to a file on the filesystem.
Supports both read and write (save) operations.AConfigSourceimplementation that reads from a predefined yaml string in memory.
Supports ONLY read operations.