15 lines
522 B
Java
15 lines
522 B
Java
package games.dmg.fantasystick.persistence;
|
|
|
|
import java.io.IOException;
|
|
import java.nio.channels.FileChannel;
|
|
import java.nio.file.Path;
|
|
import java.nio.file.StandardOpenOption;
|
|
|
|
/** Filesystem durability boundary used after atomically replacing or deleting acknowledged state. */
|
|
final class DurableFiles {
|
|
private DurableFiles() { }
|
|
static void forceDirectory(Path directory) throws IOException {
|
|
try (var channel = FileChannel.open(directory, StandardOpenOption.READ)) { channel.force(true); }
|
|
}
|
|
}
|