Add support for using https:// references to HL7 website
This commit is contained in:
parent
c827a06698
commit
9862f0a390
|
@ -24,8 +24,10 @@ import com.google.gson.JsonObject;
|
||||||
*/
|
*/
|
||||||
public class PackageHacker {
|
public class PackageHacker {
|
||||||
|
|
||||||
|
private static boolean useSecureReferences = false;
|
||||||
|
|
||||||
public static void main(String[] args) throws FileNotFoundException, IOException {
|
public static void main(String[] args) throws FileNotFoundException, IOException {
|
||||||
new PackageHacker().edit("M:\\web\\hl7.org\\fhir\\us\\carin-rtpbc\\package.tgz");
|
new PackageHacker().edit("M:\\web\\hl7.org\\fhir\\2021Mar\\hl7.fhir.r4b.expansions.tgz");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void edit(String name) throws FileNotFoundException, IOException {
|
private void edit(String name) throws FileNotFoundException, IOException {
|
||||||
|
@ -57,8 +59,8 @@ public class PackageHacker {
|
||||||
|
|
||||||
private void change(JsonObject npm, Map<String, byte[]> content) throws FileNotFoundException, IOException {
|
private void change(JsonObject npm, Map<String, byte[]> content) throws FileNotFoundException, IOException {
|
||||||
fixVersions(npm);
|
fixVersions(npm);
|
||||||
npm.remove("url");
|
npm.remove("notForPublication");
|
||||||
npm.addProperty("url", "http://hl7.org/fhir/us/carin-rtpbc/STU1");
|
// npm.addProperty("url", "http://hl7.org/fhir/us/carin-rtpbc/STU1");
|
||||||
// npm.remove("name");
|
// npm.remove("name");
|
||||||
// npm.addProperty("name", "hl7.fhir.uv.smart-app-launch");
|
// npm.addProperty("name", "hl7.fhir.uv.smart-app-launch");
|
||||||
// npm.remove("canonical");
|
// npm.remove("canonical");
|
||||||
|
@ -137,7 +139,19 @@ public class PackageHacker {
|
||||||
case "file://C:\\GitHub\\hl7.fhir.uv.security-label-ds4p#0.1.0\\output": return "http://hl7.org/fhir/uv/security-label-ds4p/2020May";
|
case "file://C:\\GitHub\\hl7.fhir.uv.security-label-ds4p#0.1.0\\output": return "http://hl7.org/fhir/uv/security-label-ds4p/2020May";
|
||||||
case "file://C:\\GitHub\\hl7.fhir.uv.shorthand#0.12.0\\output": return "http://hl7.org/fhir/uv/shorthand/2020May";
|
case "file://C:\\GitHub\\hl7.fhir.uv.shorthand#0.12.0\\output": return "http://hl7.org/fhir/uv/shorthand/2020May";
|
||||||
}
|
}
|
||||||
|
if (isUseSecureReferences()) {
|
||||||
|
return webref.replace("http://hl7.org/fhir", "https://hl7.org/fhir").replace("http://build.fhir.org", "https://build.fhir.org");
|
||||||
|
} else {
|
||||||
return webref;
|
return webref;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isUseSecureReferences() {
|
||||||
|
return useSecureReferences;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setUseSecureReferences(boolean useSecureReferences) {
|
||||||
|
PackageHacker.useSecureReferences = useSecureReferences;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue