feat: 新增实例相关异常、现在实例容器是线程安全的

This commit is contained in:
2024-05-25 11:54:22 +08:00
parent 2211a6edc0
commit 6f5050269b
10 changed files with 142 additions and 66 deletions

View File

@@ -110,7 +110,7 @@ public final class SystemInitializer implements Refreshable, Clearable {
ClassLoader classLoader = SystemConstants.class.getClassLoader();
Path path = Paths.get(SystemConstants.USER_DIR + File.separator + resourceName);
// 检查文件是否已存在
if(Files.exists(path)){
if (Files.exists(path)) {
log.debug("文件 {} 已存在, 无需解压.", resourceName);
return;
}
@@ -120,10 +120,9 @@ public final class SystemInitializer implements Refreshable, Clearable {
OutputStream outputStream = Files.newOutputStream(path);
byte[] buffer = new byte[1024];
int bytesRead;
if(inputStream != null) {
while ((bytesRead = inputStream.read(buffer)) != -1) {
if (inputStream != null) {
while ((bytesRead = inputStream.read(buffer)) != -1)
outputStream.write(buffer, 0, bytesRead);
}
}
outputStream.close();
} catch (Exception e) {