This repository has been archived by the owner on Jun 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
230 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
address: 0.0.0.0 | ||
port: 8000 | ||
performance-mode: false | ||
jks-certificate-file: | ||
jks-certificate-pass: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* 用于缓存文件生成的hash值的一个Map,已经生成的hash可以直接获取到,不用重复生成了,可以提升效率 | ||
* | ||
* @param base 基本目录,用来配合relativePath来定位具体文件 | ||
*/ | ||
class HashCacher(val base: File2) | ||
{ | ||
private val cache = mutableMapOf<String, String>() | ||
|
||
fun getHash(relativePath: String): String | ||
{ | ||
if (relativePath !in cache) | ||
{ | ||
val file = base + relativePath | ||
cache[relativePath] = file.sha1 | ||
} | ||
|
||
return cache[relativePath]!! | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.