Package org.nuxeo.ecm.core.blob
Class PathStrategyShortened
- java.lang.Object
-
- org.nuxeo.ecm.core.blob.PathStrategy
-
- org.nuxeo.ecm.core.blob.PathStrategyShortened
-
public class PathStrategyShortened extends PathStrategy
Extends the defaultPathStrategy.safePath(String)method to ensure resulting path and file name is not too long.- Since:
- 2021.14
-
-
Field Summary
-
Fields inherited from class org.nuxeo.ecm.core.blob.PathStrategy
dir, HEX, SAFE
-
-
Constructor Summary
Constructors Constructor Description PathStrategyShortened(Path dir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PathgetPathForKey(String key)Gets the storage path for a given key.protected StringsafePath(String key)Converts a key to a safe path.protected StringsafePathInverse(String path)Inverse ofPathStrategy.safePath(java.lang.String).-
Methods inherited from class org.nuxeo.ecm.core.blob.PathStrategy
atomicCopy, atomicMove, createTempFile, getKeyForPath, isTempFile
-
-
-
-
Constructor Detail
-
PathStrategyShortened
public PathStrategyShortened(Path dir)
-
-
Method Detail
-
safePath
protected String safePath(String key)
Description copied from class:PathStrategyConverts a key to a safe path.Different keys always map to different safe paths (no collision).
- Overrides:
safePathin classPathStrategy- Parameters:
key- the key- Returns:
- the safe path
-
safePathInverse
protected String safePathInverse(String path)
Description copied from class:PathStrategyInverse ofPathStrategy.safePath(java.lang.String).- Overrides:
safePathInversein classPathStrategy- Parameters:
path- the safe path- Returns:
- the key, or
nullif the safe path is invalid
-
getPathForKey
public Path getPathForKey(String key)
Description copied from class:PathStrategyGets the storage path for a given key.- Specified by:
getPathForKeyin classPathStrategy- Parameters:
key- the key- Returns:
- the file for this key
-
-