mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-03-09 14:31:17 +00:00
utils support
This commit is contained in:
parent
c4bcd19f46
commit
04aef18307
@ -567,5 +567,6 @@ public class I18nConstants {
|
||||
public static final String FHIRPATH_DISCRIMINATOR_MULTIPLE_PROFILES = "FHIRPATH_DISCRIMINATOR_MULTIPLE_PROFILES";
|
||||
public static final String FHIRPATH_UNABLE_BOOLEAN = "FHIRPATH_UNABLE_BOOLEAN";
|
||||
public static final String XHTML_XHTML_DOCTYPE_ILLEGAL = "XHTML_XHTML_DOCTYPE_ILLEGAL";
|
||||
public static final String PACKAGE_VERSION_MISMATCH = "PACKAGE_VERSION_MISMATCH";
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,15 @@
|
||||
package org.hl7.fhir.utilities.json;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.hl7.fhir.utilities.TextFile;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
@ -128,4 +133,10 @@ public class JSONUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static JsonObject fetchJson(String source) throws IOException {
|
||||
URL url = new URL(source);
|
||||
URLConnection c = url.openConnection();
|
||||
return (JsonObject) new com.google.gson.JsonParser().parse(TextFile.streamToString(c.getInputStream()));
|
||||
}
|
||||
|
||||
}
|
@ -567,4 +567,4 @@ FHIRPATH_DISCRIMINATOR_MULTIPLE_TYPES = Error in discriminator at {0}: no childr
|
||||
FHIRPATH_DISCRIMINATOR_MULTIPLE_PROFILES = Error in discriminator at {0}: no children, multiple type profiles
|
||||
FHIRPATH_UNABLE_BOOLEAN = Unable to evaluate as a boolean: {0}
|
||||
XHTML_XHTML_DOCTYPE_ILLEGAL = Malformed XHTML: Found a DocType declaration, and these are not allowed (XXE security vulnerability protection)
|
||||
|
||||
PACKAGE_VERSION_MISMATCH = FHIR Version mismatch in package {0}: version is {2} but must be {1} (path: {3})
|
||||
|
Loading…
x
Reference in New Issue
Block a user