public class SonicFileUtils
extends java.lang.Object
构造器和说明 |
---|
SonicFileUtils() |
限定符和类型 | 方法和说明 |
---|---|
static java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getHeaderFromLocalCache(java.lang.String headerPath)
Get headers from local cache file
|
static java.lang.String |
getSonicResourceHeaderPath(java.lang.String resourceName) |
static java.lang.String |
getSonicResourcePath(java.lang.String resourceName) |
static byte[] |
readFileToBytes(java.io.File file) |
static boolean |
verifyData(byte[] content,
java.lang.String targetSha1)
This method computes hash value by using specified SHA1 digest algorithm and compares hash value to the specified hash @{code targetSha1}.
|
public static java.lang.String getSonicResourcePath(java.lang.String resourceName)
resourceName
- resource file namepublic static java.lang.String getSonicResourceHeaderPath(java.lang.String resourceName)
resourceName
- resource file namepublic static boolean verifyData(byte[] content, java.lang.String targetSha1)
content
- Data bytestargetSha1
- The specified hash valuetrue
if the given hash value
equivalent to computed hash value, false
otherwisepublic static byte[] readFileToBytes(java.io.File file)
file
- path of the file to readpublic static java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaderFromLocalCache(java.lang.String headerPath)
headerPath
- header file path