Example usage for org.apache.commons.configuration XMLConfiguration registerEntityId

List of usage examples for org.apache.commons.configuration XMLConfiguration registerEntityId

Introduction

In this page you can find the example usage for org.apache.commons.configuration XMLConfiguration registerEntityId.

Prototype

public void registerEntityId(String publicId, URL entityURL) 

Source Link

Document

Registers the specified DTD URL for the specified public identifier.

Usage

From source file:io.datalayer.conf.XmlConfigurationTest.java

/**
 * Tests registering the publicId of a DTD.
 *///from   www.  j  ava2  s  .  co m
@Test
public void testRegisterEntityId() throws Exception {
    URL dtdURL = getClass().getResource("/properties.dtd");
    final String publicId = "http://commons.apache.org/test/properties.dtd";
    conf = new XMLConfiguration("testDtd.xml");
    conf.setPublicID(publicId);
    conf.save(testSaveConf);
    XMLConfiguration checkConfig = new XMLConfiguration();
    checkConfig.setFile(testSaveConf);
    checkConfig.registerEntityId(publicId, dtdURL);
    checkConfig.setValidating(true);
    checkSavedConfig(checkConfig);
}