Skip to content

Commit

Permalink
Throw a UserException when miss plugin's md5 file (apache#3542)
Browse files Browse the repository at this point in the history
  • Loading branch information
WingsGo authored May 11, 2020
1 parent 57cbfb7 commit edbeaf8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fe/src/main/java/org/apache/doris/plugin/PluginZip.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,12 @@ Path downloadRemoteZip(Path targetPath) throws IOException, UserException {
}

// .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));
Expand Down

0 comments on commit edbeaf8

Please sign in to comment.