sonic-android/docs/javadoc/com/tencent/sonic/sdk/SonicFileUtils.html
com.tencent.sonic.sdk
java.lang.Object
public classSonicFileUtilsextends java.lang.Object
Interact with the overall file operations.
构造器 | 构造器和说明 |
| --- |
| 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}.
|
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public SonicFileUtils()
-
public static java.lang.String getSonicResourcePath(java.lang.String resourceName)
参数:resourceName - resource file name返回:The path of the resource file.
-
public static java.lang.String getSonicResourceHeaderPath(java.lang.String resourceName)
参数:resourceName - resource file name返回:The path of the resource header file.
-
public 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}.
参数:content - Data bytestargetSha1 - The specified hash value返回:true if the given hash value equivalent to computed hash value, false otherwise
-
public static byte[] readFileToBytes(java.io.File file)
参数:file - path of the file to read返回:Returns the content bytes read from the file.
-
public static java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaderFromLocalCache(java.lang.String headerPath)
Get headers from local cache file
参数:headerPath - header file path返回:The last http response headers from local cache.