com.axway.ats.config.ConfigurationResource Maven / Gradle / Ivy
/*
* Copyright 2017 Axway Software
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.axway.ats.config;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
import org.apache.log4j.Logger;
import org.apache.xerces.parsers.DOMParser;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import com.axway.ats.config.exceptions.ConfigurationException;
/**
* Presentation of a configuration resource.
* Internally it is a list of key-value parameters.
*/
public class ConfigurationResource {
private static final Logger log = Logger.getLogger( ConfigurationResource.class );
private Properties properties;
public ConfigurationResource() {
properties = new Properties();
}
public String getProperty(
String name ) {
String propertyValue = properties.getProperty( name );
if( propertyValue != null ) {
propertyValue = propertyValue.trim();
}
return propertyValue;
}
public Map getProperties(
String prefix ) {
HashMap result = new HashMap();
for( Map.Entry
© 2015 - 2025 Weber Informatics LLC | Privacy Policy