@Override public LSInput resolveResource(String theType, String theNamespaceURI, String thePublicId, String theSystemId, String theBaseURI) { if (theSystemId != null && SCHEMA_NAMES.contains(theSystemId)) { LSInputImpl input = new LSInputImpl(); input.setPublicId(thePublicId); input.setSystemId(theSystemId); input.setBaseURI(theBaseURI); // String pathToBase = "ca/uhn/fhir/model/" + myVersion + "/schema/" + theSystemId; String pathToBase = myCtx.getVersion().getPathToSchemaDefinitions() + '/' + theSystemId; ourLog.debug("Loading referenced schema file: " + pathToBase); InputStream baseIs = FhirValidator.class.getResourceAsStream(pathToBase); if (baseIs == null) { throw new InternalErrorException("Schema file not found: " + pathToBase); } input.setByteStream(baseIs); //FIXME resource leak return input; } throw new ConfigurationException("Unknown schema: " + theSystemId); } }
@Override public LSInput resolveResource(String theType, String theNamespaceURI, String thePublicId, String theSystemId, String theBaseURI) { if (theSystemId != null && SCHEMA_NAMES.contains(theSystemId)) { LSInputImpl input = new LSInputImpl(); input.setPublicId(thePublicId); input.setSystemId(theSystemId); input.setBaseURI(theBaseURI); // String pathToBase = "ca/uhn/fhir/model/" + myVersion + "/schema/" + theSystemId; String pathToBase = myCtx.getVersion().getPathToSchemaDefinitions() + '/' + theSystemId; ourLog.debug("Loading referenced schema file: " + pathToBase); InputStream baseIs = FhirValidator.class.getResourceAsStream(pathToBase); if (baseIs == null) { throw new InternalErrorException("Schema file not found: " + pathToBase); } input.setByteStream(baseIs); //FIXME resource leak return input; } throw new ConfigurationException("Unknown schema: " + theSystemId); } }