Throw a UserException when miss plugin's md5 file (#3542)

This commit is contained in:
WingC
2020-05-11 02:33:35 -05:00
committed by GitHub
parent 57cbfb772d
commit edbeaf8e30

View File

@ -118,10 +118,12 @@ class PluginZip {
}
// .md5 check
String expectedChecksum = "";
String expectedChecksum;
try (InputStream in = openUrlInputStream(source + ".md5")) {
BufferedReader br = new BufferedReader(new InputStreamReader(in));
expectedChecksum = br.readLine();
} catch (IOException e) {
throw new UserException(e.getMessage() + ". you should provide a md5 URI to check plugin file");
}
DigestUtils.md5Hex(Files.readAllBytes(zip));