Class PathStrategySubDirs


  • public class PathStrategySubDirs
    extends PathStrategy
    Stores a file in a nested subdirectory based on the initial characters of the key, in groups of 2. The key is restricted the a safe subset of characters to use as filenames.

    For instance for a depth of 3 and a key of 1234567890abcd the path will be 12/34/56/1234567890abcd.

    Since:
    11.1
    • Field Detail

      • depth

        protected final int depth
    • Constructor Detail

      • PathStrategySubDirs

        public PathStrategySubDirs​(Path dir,
                                   int depth)
    • Method Detail

      • getPathForKey

        public Path getPathForKey​(String key)
        Description copied from class: PathStrategy
        Gets the storage path for a given key.
        Specified by:
        getPathForKey in class PathStrategy
        Parameters:
        key - the key
        Returns:
        the file for this key