in src/main/java/com/googlesource/gerrit/plugins/websession/flatfile/FlatFileWebSessionCache.java [166:181]
public void put(String key, Val value) {
try {
Path tempFile = Files.createTempFile(websessionsDir, UUID.randomUUID().toString(), null);
try (OutputStream fileStream = Files.newOutputStream(tempFile);
ObjectOutputStream objStream = new ObjectOutputStream(fileStream)) {
objStream.writeObject(value);
Files.move(
tempFile,
tempFile.resolveSibling(key),
StandardCopyOption.REPLACE_EXISTING,
StandardCopyOption.ATOMIC_MOVE);
}
} catch (IOException e) {
log.atWarning().withCause(e).log("Cannot put into cache %s", websessionsDir);
}
}