public final class SiteCacheHelper extends Object
Modifier and Type | Field and Description |
---|---|
private static String |
__MD5_PREFIX |
Modifier | Constructor and Description |
---|---|
private |
SiteCacheHelper() |
Modifier and Type | Method and Description |
---|---|
static String |
getHashedFilePath(File file)
Get a hashed file path for the given file.
|
static String |
getHashedFilePath(File file,
boolean encode)
Get a hashed file path for the given file.
|
static String |
getHashedFilePath(String filePath)
Get a hashed version of the given file path.
|
static String |
getHashedFilePath(String filePath,
boolean encode)
Get a hashed version of the given file path.
|
static Source |
getHashedFileSource(SourceResolver resolver,
FileSource source)
Release the given file source and resolve a hashed version of the file to replace it.
|
static File |
getRootCache()
Return the root cache file
|
private static String |
hashPath(String path,
boolean encode)
Hash the resource path
|
static boolean |
isValid(File file)
Test if a file is valid.
|
static boolean |
isValid(FileSource fileSource)
Test if a file source is valid.
|
private static final String __MD5_PREFIX
private SiteCacheHelper()
public static File getRootCache()
public static boolean isValid(File file)
file
- the file to test.public static boolean isValid(FileSource fileSource)
fileSource
- the file source to test.public static String getHashedFilePath(File file)
file
- the original resource file.public static String getHashedFilePath(File file, boolean encode)
file
- the original resource file.encode
- true to encode the folder parts, false otherwise.public static String getHashedFilePath(String filePath)
filePath
- the original file path.public static String getHashedFilePath(String filePath, boolean encode)
filePath
- the original file path.encode
- true to encode the folder parts, false otherwise.public static Source getHashedFileSource(SourceResolver resolver, FileSource source) throws IOException, ProcessingException
resolver
- the source resolver.source
- the invalid file source to hash.IOException
- if an IO error occurs.ProcessingException
- if the new source couldn't be resolved.