public class MiscellaneousUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
asBytes(java.io.InputStream in) |
static java.lang.String |
getProperty(java.util.Properties properties,
java.lang.String name,
java.lang.String defaultValue)
Helper method to get the value of the property from a given property bag
|
static <T> T |
getProperty(java.util.Properties properties,
java.lang.String name,
T defaultValue,
java.lang.Class<? extends T> type)
Helper method to get the value of the property from a given property bag
This method will return a value with the type equal to the type
given by the Class type parameter.
|
static java.util.Properties |
loadProperties(java.lang.String filePath)
Loads the properties from a given property file path
|
static org.apache.axiom.om.OMElement |
loadXMLConfig(java.lang.String filePath)
Load a xml configuration file
|
static byte[] |
serialize(java.lang.Object data)
Helper method to serialize object into a byte array
|
public static java.lang.String getProperty(java.util.Properties properties, java.lang.String name, java.lang.String defaultValue)
properties
- The property collectionname
- The name of the propertydefaultValue
- The default value for the propertypublic static <T> T getProperty(java.util.Properties properties, java.lang.String name, T defaultValue, java.lang.Class<? extends T> type)
properties
- Properties bagname
- Name of the propertydefaultValue
- Default valuetype
- Expected Type using Classpublic static java.util.Properties loadProperties(java.lang.String filePath)
filePath
- Path of the property filepublic static org.apache.axiom.om.OMElement loadXMLConfig(java.lang.String filePath)
filePath
- file pathpublic static byte[] serialize(java.lang.Object data)
data
- The object to be serializedpublic static byte[] asBytes(java.io.InputStream in)
Copyright © 2005-2021 Apache Software Foundation. All Rights Reserved.