SchemaBaseValidator.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:hapi-fhir 作者:
@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) {
            IOUtils.closeQuietly(baseIs);
            throw new InternalErrorException("Schema file not found: " + pathToBase);
        }

        input.setByteStream(baseIs);
        //FIXME resource leak
        return input;

    }

    throw new ConfigurationException("Unknown schema: " + theSystemId);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号