Class AtomicFiles
java.lang.Object
dev.despical.mazeengine.storage.AtomicFiles
Writes saved documents through temporary files and destination replacement.
Text writes create the parent directory, write a sibling temporary file, and force its contents before replacing the destination. The move requests atomic replacement where supported and falls back to ordinary replacement when the filesystem does not support an atomic move.
Temporary files are cleaned in a finally block. Maze records and schematic writers share the replacement helper, while callers serialize disk operations through their storage executor. A fallback move is not claimed to provide the same atomicity guarantees as an atomic filesystem replacement.
-
Method Summary
-
Method Details
-
move
- Throws:
IOException
-
write
- Throws:
IOException
-