Example usage for java.util InvalidPropertiesFormatException getMessage

List of usage examples for java.util InvalidPropertiesFormatException getMessage

Introduction

In this page you can find the example usage for java.util InvalidPropertiesFormatException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:org.duracloud.common.util.ApplicationConfig.java

public static Properties getPropsFromXmlStream(InputStream propsXmlStream) {
    Properties props = new Properties();
    try {//from w  ww . j  a v  a 2  s.  co m
        props.loadFromXML(propsXmlStream);
    } catch (InvalidPropertiesFormatException e) {
        log.error(e.getMessage());
        log.error(ExceptionUtil.getStackTraceAsString(e));
        throw new RuntimeException(e);
    } catch (IOException e) {
        log.error(e.getMessage());
        log.error(ExceptionUtil.getStackTraceAsString(e));
        throw new RuntimeException(e);
    } finally {
        if (propsXmlStream != null) {
            try {
                propsXmlStream.close();
            } catch (IOException e) {
                String error = "Error closing properties stream: " + e.getMessage();
                throw new RuntimeException(error, e);
            }
        }
    }

    return props;
}