mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Canonicalize file to where ChronicleMaps are persisted, to ensure CanonicalRandomAccessFiles work in the face of symbolic links provided to ChronicleMapBuilder (but unfortunately not hard links)
This commit is contained in:
@@ -1463,6 +1463,9 @@ public final class ChronicleMapBuilder<K, V> implements
|
||||
replicated = replicationIdentifier != -1;
|
||||
persisted = true;
|
||||
|
||||
// It's important to canonicalize the file, because CanonicalRandomAccessFiles.acquire()
|
||||
// relies on java.io.File equality, which doesn't account symlinks itself.
|
||||
file = file.getCanonicalFile();
|
||||
if (!file.exists()) {
|
||||
if (recover)
|
||||
throw new FileNotFoundException("file " + file + " should exist for recovery");
|
||||
|
||||
Reference in New Issue
Block a user