Java Code Examples for org.apache.atlas.ApplicationProperties#APPLICATION_PROPERTIES

The following examples show how to use org.apache.atlas.ApplicationProperties#APPLICATION_PROPERTIES . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SecureEmbeddedServer.java    From atlas with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the application configuration.
 * @return
 */
protected org.apache.commons.configuration.Configuration getConfiguration() {
    try {
        return ApplicationProperties.get();
    } catch (AtlasException e) {
        throw new RuntimeException("Unable to load configuration: " + ApplicationProperties.APPLICATION_PROPERTIES);
    }
}
 
Example 2
Source File: BaseSecurityTest.java    From atlas with Apache License 2.0 5 votes vote down vote up
protected void generateTestProperties(Properties props) throws ConfigurationException, IOException {
    PropertiesConfiguration config =
            new PropertiesConfiguration(System.getProperty("user.dir") +
              "/../src/conf/" + ApplicationProperties.APPLICATION_PROPERTIES);
    for (String propName : props.stringPropertyNames()) {
        config.setProperty(propName, props.getProperty(propName));
    }
    File file = new File(System.getProperty("user.dir"), ApplicationProperties.APPLICATION_PROPERTIES);
    file.deleteOnExit();
    Writer fileWriter = new FileWriter(file);
    config.save(fileWriter);
}
 
Example 3
Source File: SecureEmbeddedServer.java    From incubator-atlas with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the application configuration.
 * @return
 */
protected org.apache.commons.configuration.Configuration getConfiguration() {
    try {
        return ApplicationProperties.get();
    } catch (AtlasException e) {
        throw new RuntimeException("Unable to load configuration: " + ApplicationProperties.APPLICATION_PROPERTIES);
    }
}
 
Example 4
Source File: BaseSecurityTest.java    From incubator-atlas with Apache License 2.0 5 votes vote down vote up
protected void generateTestProperties(Properties props) throws ConfigurationException, IOException {
    PropertiesConfiguration config =
            new PropertiesConfiguration(System.getProperty("user.dir") +
              "/../src/conf/" + ApplicationProperties.APPLICATION_PROPERTIES);
    for (String propName : props.stringPropertyNames()) {
        config.setProperty(propName, props.getProperty(propName));
    }
    File file = new File(System.getProperty("user.dir"), ApplicationProperties.APPLICATION_PROPERTIES);
    file.deleteOnExit();
    Writer fileWriter = new FileWriter(file);
    config.save(fileWriter);
}
 
Example 5
Source File: TestReportLineageToAtlas.java    From nifi with Apache License 2.0 4 votes vote down vote up
private void saveAtlasConf(String atlasConfDir, Properties atlasConf) throws IOException {
    FileOutputStream fos = new FileOutputStream(atlasConfDir + File.separator + ApplicationProperties.APPLICATION_PROPERTIES);
    atlasConf.store(fos, "Atlas test config");
}