Class AtomicFiles
java.lang.Object
org.spongepowered.configurate.loader.AtomicFiles
A utility for creating "atomic" file writers.
 
An atomic writer copies any existing file at the given path to a temporary location, then writes to the same temporary location, before moving the file back to the desired output path once the write is fully complete.
- Since:
- 4.0.0
- 
Method SummaryModifier and TypeMethodDescriptionstatic BufferedWriteratomicBufferedWriter(Path path, Charset charset) Creates and returns an "atomic" writer for the given path.static Callable<BufferedWriter>atomicWriterFactory(Path path, Charset charset) Creates and returns an "atomic" writer factory for the given path.
- 
Method Details- 
atomicWriterFactoryCreates and returns an "atomic" writer factory for the given path.- Parameters:
- path- path the complete file should be written to
- charset- the charset to be used by the writer
- Returns:
- a new writer factory
- Since:
- 4.0.0
 
- 
atomicBufferedWriterCreates and returns an "atomic" writer for the given path.- Parameters:
- path- the path
- charset- the charset to be used by the writer
- Returns:
- a new writer factory
- Throws:
- IOException- for any underlying filesystem errors
- Since:
- 4.0.0
 
 
-