public class MiscellaneousUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
asBytes(InputStream in) |
static boolean |
elementHasText(org.apache.axiom.om.OMElement element) |
static String |
getProperty(Properties properties,
String name,
String defaultValue)
Helper method to get the value of the property from a given property bag
|
static <T> T |
getProperty(Properties properties,
String name,
T defaultValue,
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 String |
getProtectedToken(String text) |
static boolean |
isValidPropertyValue(String propValue)
Validate the property value to avoid the processing of null values.
|
static Properties |
loadProperties(String filePath)
Loads the properties from a given property file path
|
static String |
resolve(org.apache.axiom.om.OMAttribute attribute,
SecretResolver secretResolver) |
static String |
resolve(org.apache.axiom.om.OMElement omElement,
SecretResolver secretResolver) |
static String |
resolve(String inputText,
SecretResolver secretResolver) |
public static String getProperty(Properties properties, String name, String defaultValue)
properties - The property collectionname - The name of the propertydefaultValue - The default value for the propertypublic static <T> T getProperty(Properties properties, String name, T defaultValue, Class<? extends T> type)
properties - Properties bagname - Name of the propertydefaultValue - Default valuetype - Expected Type using Classpublic static Properties loadProperties(String filePath)
filePath - Path of the property filepublic static byte[] asBytes(InputStream in)
public static boolean elementHasText(org.apache.axiom.om.OMElement element)
public static String resolve(org.apache.axiom.om.OMElement omElement, SecretResolver secretResolver)
public static String resolve(String inputText, SecretResolver secretResolver)
public static String resolve(org.apache.axiom.om.OMAttribute attribute, SecretResolver secretResolver)
public static boolean isValidPropertyValue(String propValue)
propValue - Value of the required property.Copyright © 2020 WSO2. All rights reserved.