|
|
|
|
@ -164,14 +164,18 @@ public class S101Configurer {
@@ -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()) { |
|
|
|
|
copyZipToFilesystem(source, installationDirectory, matcher.group(1) + matcher.group(2)); |
|
|
|
|
return matcher.group(2); |
|
|
|
|
Matcher candidate = Pattern.compile("(structure101-build-java-all-)(.*).zip").matcher(anchor.getHrefAttribute()); |
|
|
|
|
if (candidate.find()) { |
|
|
|
|
matcher = candidate; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
if (matcher == null) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
copyZipToFilesystem(source, installationDirectory, matcher.group(1) + matcher.group(2)); |
|
|
|
|
return matcher.group(2); |
|
|
|
|
} catch (Exception ex) { |
|
|
|
|
throw new RuntimeException(ex); |
|
|
|
|
} |
|
|
|
|
|