|
@@ -129,7 +129,7 @@ public class FileUpdateInfoServiceImpl implements FileUpdateInfoService {
|
|
if (!backupDir.exists()) {
|
|
if (!backupDir.exists()) {
|
|
boolean created = backupDir.mkdirs();
|
|
boolean created = backupDir.mkdirs();
|
|
if (!created) {
|
|
if (!created) {
|
|
- throw new IOException("无法创建备份目录: " + backupDirPath);
|
|
|
|
|
|
+ throw new IOException("无法创建备份目录");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -163,11 +163,11 @@ public class FileUpdateInfoServiceImpl implements FileUpdateInfoService {
|
|
controlApplication(fileName, "restart");
|
|
controlApplication(fileName, "restart");
|
|
|
|
|
|
} catch (FileNotFoundException e) {
|
|
} catch (FileNotFoundException e) {
|
|
- throw new Exception("文件未找到: " + localFilePath + ",原因: " + e.getMessage(), e);
|
|
|
|
|
|
+ throw new Exception("原因: " + e.getMessage(), e);
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
- throw new Exception("文件写入失败: " + localFilePath + ",原因: " + e.getMessage(), e);
|
|
|
|
|
|
+ throw new Exception("原因: " + e.getMessage(), e);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- throw new Exception("文件更新失败: " + localFilePath + ",原因: " + e.getMessage(), e);
|
|
|
|
|
|
+ throw new Exception("原因: 远程仓库未找到服务包");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -176,10 +176,10 @@ public class FileUpdateInfoServiceImpl implements FileUpdateInfoService {
|
|
Path path = Paths.get(localFilePath);
|
|
Path path = Paths.get(localFilePath);
|
|
try {
|
|
try {
|
|
Files.copy(url.openStream(), path, StandardCopyOption.REPLACE_EXISTING);
|
|
Files.copy(url.openStream(), path, StandardCopyOption.REPLACE_EXISTING);
|
|
- System.out.println("文件下载成功: " + localFilePath);
|
|
|
|
|
|
+ System.out.println("文件下载成功");
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
- System.err.println("文件下载失败: " + localFilePath + ",原因: " + e.getMessage());
|
|
|
|
- throw new Exception("文件下载失败: " + localFilePath, e);
|
|
|
|
|
|
+ System.err.println("文件下载失败" + ",原因: " + e.getMessage());
|
|
|
|
+ throw new Exception("文件下载失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|