Class FileModeCache


  • public class FileModeCache
    extends Object
    A hierarchical cache of FileModes per git path.
    Since:
    6.6.1
    • Method Detail

      • safeCreateParentDirectory

        public void safeCreateParentDirectory​(String gitPath,
                                              File parentDir,
                                              boolean makeSpace)
                                       throws IOException
        Ensure that the given parent directory exists, and cache the information that gitPath refers to a file.
        Parameters:
        gitPath - of the file to be written
        parentDir - directory in which the file shall be placed, assumed to be the parent of the gitPath
        makeSpace - whether to delete a possibly existing file at parentDir
        Throws:
        IOException - if the directory cannot be created, if necessary
      • safeCreateDirectory

        public FileModeCache.CacheItem safeCreateDirectory​(String gitPath,
                                                           File dir,
                                                           boolean makeSpace)
                                                    throws IOException
        Ensures the given directory dir with the given git path exists.
        Parameters:
        gitPath - of a file to be written
        dir - directory in which the file shall be placed, assumed to be the parent of the gitPath
        makeSpace - whether to remove a file that already at that name
        Returns:
        A FileModeCache.CacheItem describing the directory, which is guaranteed to exist
        Throws:
        IOException - if the directory cannot be made to exist at the given location