Class SiteCacheHelper

    • Method Detail

      • getRootCache

        public static File getRootCache()
        Return the root cache file
        Returns:
        The root cache File
      • isValid

        public static boolean isValid​(File file)
        Test if a file is valid.
        Parameters:
        file - the file to test.
        Returns:
        true if the file is valid, false otherwise.
      • isValid

        public static boolean isValid​(FileSource fileSource)
        Test if a file source is valid.
        Parameters:
        fileSource - the file source to test.
        Returns:
        true if the file is valid, false otherwise.
      • getHashedFilePath

        public static String getHashedFilePath​(File file)
        Get a hashed file path for the given file.
        Parameters:
        file - the original resource file.
        Returns:
        the hashed file path.
      • getHashedFilePath

        public static String getHashedFilePath​(File file,
                                               boolean encode)
        Get a hashed file path for the given file.
        Parameters:
        file - the original resource file.
        encode - true to encode the folder parts, false otherwise.
        Returns:
        the hashed file path.
      • getHashedFilePath

        public static String getHashedFilePath​(String filePath)
        Get a hashed version of the given file path.
        Parameters:
        filePath - the original file path.
        Returns:
        the hashed file path.
      • getHashedFilePath

        public static String getHashedFilePath​(String filePath,
                                               boolean encode)
        Get a hashed version of the given file path.
        Parameters:
        filePath - the original file path.
        encode - true to encode the folder parts, false otherwise.
        Returns:
        the hashed file path.
      • hashPath

        private static String hashPath​(String path,
                                       boolean encode)
        Hash the resource path
        Parameters:
        path - the resource path
        encode - true to encode the un-hashed paths, false otherwise.
        Returns:
        the hashed and encoded URI