Class Configuration

java.lang.Object
org.torproject.metrics.collector.conf.Configuration

public class Configuration
extends java.lang.Object
Initialize configuration with defaults from collector.properties, unless a configuration properties file is available.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.String FIELDSEP  
  • Constructor Summary

    Constructors 
    Constructor Description
    Configuration()  
  • Method Summary

    Modifier and Type Method Description
    void clear()
    clears all properties.
    boolean getBool​(Key key)
    Returns a boolean property (case insensitiv), e.g.
    int getInt​(Key key)
    Parse an integer property and translate the String "inf" into Integer.MAX_VALUE.
    long getLong​(Key key)
    Parse a long property.
    java.nio.file.Path getPath​(Key key)
    Returns a Path property, e.g.
    java.util.Properties getPropertiesCopy()
    Return a copy of all properties.
    java.lang.String getProperty​(java.lang.String key)
    Retrieves the value for key.
    java.lang.String getProperty​(java.lang.String key, java.lang.String def)
    Retrieves the value for key returning a default for non-existing keys.
    java.util.Set<SourceType> getSourceTypeSet​(Key key)
    Returns a SourceType as List, e.g.
    java.lang.String[] getStringArray​(Key key)
    Returns String[] from a property.
    java.net.URL getUrl​(Key key)
    Returns a URL property, e.g.
    java.net.URL[] getUrlArray​(Key key)
    Returns URL[] from a property.
    void load​(java.io.InputStream fis)
    Loads properties from the given stream.
    void loadAndCheckConfiguration​(java.nio.file.Path confPath)
    Load the configuration from the given path.
    void putAll​(java.util.Properties allProps)
    Add all given properties.
    void setProperty​(java.lang.String key, java.lang.String value)
    Sets the value for key.
    int size()
    Count of properties.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait