Pull most recent Structure101 version

Closes gh-10696
This commit is contained in:
Josh Cummings 2022-01-11 09:58:35 -07:00
parent 60ed3602f6
commit 194eaf8491
1 changed files with 9 additions and 5 deletions

View File

@ -164,14 +164,18 @@ public class S101Configurer {
String source = "https://structure101.com/binaries/v6";
try (final WebClient webClient = new WebClient()) {
HtmlPage page = webClient.getPage(source);
Matcher matcher = null;
for (HtmlAnchor anchor : page.getAnchors()) {
Matcher matcher = Pattern.compile("(structure101-build-java-all-)(.*).zip").matcher(anchor.getHrefAttribute());
if (matcher.find()) {
Matcher candidate = Pattern.compile("(structure101-build-java-all-)(.*).zip").matcher(anchor.getHrefAttribute());
if (candidate.find()) {
matcher = candidate;
}
}
if (matcher == null) {
return null;
}
copyZipToFilesystem(source, installationDirectory, matcher.group(1) + matcher.group(2));
return matcher.group(2);
}
}
return null;
} catch (Exception ex) {
throw new RuntimeException(ex);
}