Package org.nuxeo.ecm.core.blob
Class PathStrategyShortened
java.lang.Object
org.nuxeo.ecm.core.blob.PathStrategy
org.nuxeo.ecm.core.blob.PathStrategyShortened
Extends the default
PathStrategy.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
-
Method Summary
Modifier and TypeMethodDescriptiongetPathForKey
(String key) Gets the storage path for a given key.protected String
Converts a key to a safe path.protected String
safePathInverse
(String path) Inverse ofPathStrategy.safePath(java.lang.String)
.Methods inherited from class org.nuxeo.ecm.core.blob.PathStrategy
atomicCopy, atomicMove, createTempFile, getKeyForPath, isTempFile
-
Constructor Details
-
PathStrategyShortened
-
-
Method Details
-
safePath
Description copied from class:PathStrategy
Converts a key to a safe path.Different keys always map to different safe paths (no collision).
- Overrides:
safePath
in classPathStrategy
- Parameters:
key
- the key- Returns:
- the safe path
-
safePathInverse
Description copied from class:PathStrategy
Inverse ofPathStrategy.safePath(java.lang.String)
.- Overrides:
safePathInverse
in classPathStrategy
- Parameters:
path
- the safe path- Returns:
- the key, or
null
if the safe path is invalid
-
getPathForKey
Description copied from class:PathStrategy
Gets the storage path for a given key.- Specified by:
getPathForKey
in classPathStrategy
- Parameters:
key
- the key- Returns:
- the file for this key
-