Package org.nuxeo.ecm.core.blob
Class PathStrategy
- java.lang.Object
-
- org.nuxeo.ecm.core.blob.PathStrategy
-
- Direct Known Subclasses:
PathStrategyFlat,PathStrategySubDirs
public abstract class PathStrategy extends Object
Decides at what path a given key is stored.- Since:
- 11.1
-
-
Constructor Summary
Constructors Constructor Description PathStrategy(Path dir)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static voidatomicMove(Path source, Path dest)Does an atomic move from source to dest.PathcreateTempFile()Creates a temporary file in a location suitable for efficient move to the final path for any key.abstract PathgetPathForKey(String key)Gets the storage path for a given key.
-
-
-
Constructor Detail
-
PathStrategy
public PathStrategy(Path dir)
-
-
Method Detail
-
createTempFile
public Path createTempFile()
Creates a temporary file in a location suitable for efficient move to the final path for any key.- Returns:
- the temporary file
-
getPathForKey
public abstract Path getPathForKey(String key)
Gets the storage path for a given key.- Parameters:
key- the key- Returns:
- the file for this key
-
atomicMove
public static void atomicMove(Path source, Path dest) throws IOException
Does an atomic move from source to dest.- Parameters:
source- the sourcedest- the destination- Throws:
IOException
-
-