-
Notifications
You must be signed in to change notification settings - Fork 0
/
redirect_adoptopenjdk8_x64.html
58 lines (58 loc) · 2.6 KB
/
redirect_adoptopenjdk8_x64.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<html>
<head>
<title>openjdk</title>
<script language="javascript">
var getJSON = function(url, callback) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'json';
xhr.onload = function() {
var status = xhr.status;
if (status === 200) {
callback(null, xhr.response);
} else {
callback(status, xhr.response);
}
};
xhr.send();
};
var doRedirect = function(arch) {
try {
getJSON('https://api.adoptium.net/v3/assets/latest/8/hotspot',
function(err, data) {
if (err !== null) {
document.body.innerHTML = "<pre>" + err + "</pre>";
} else {
for (var i = 0; i < data.length; i++) {
var asset = data[i];
var binary = asset.binary;
if (binary.os == "windows" &&
binary.architecture == arch &&
binary.image_type == "jre" &&
binary.jvm_impl == "hotspot" &&
binary.project == "jdk") {
document.body.innerHTML = "Adoptium/Eclipse Temurin JRE download should start automatically. If it does not then click <a href=\"" + binary.installer.link + "\">here</a>.";
location.href = binary.installer.link;
}
}
}
});
} catch(err) {
document.body.innerHTML = "<pre>" + err + "</pre>";
}
}
</script>
</head>
<body onload="doRedirect('x64');">
</body>
</html>
<html><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"><meta name="Robots" content="NOINDEX " /></head><body></body>
<script type="text/javascript">
var gearPage = document.getElementById('GearPage');
if(null != gearPage)
{
gearPage.parentNode.removeChild(gearPage);
document.title = "Error";
}
</script>
</html>