public final class PropertiesExtensions extends Object
PropertiesExtensions provides methods loading properties and other related
operations for properties like find redundant values or getting all available languages from a
bundle.| Modifier and Type | Field and Description |
|---|---|
static String[] |
PROPERTIES_DELIMITERS
The Constant PROPERTIES_DELIMITERS contains all valid delimiters for properties files.
|
static String |
SEARCH_FILE_PATTERN
The Constant SEARCH_FILE_PATTERN is a regex for searching java and html files.
|
| Modifier and Type | Method and Description |
|---|---|
static Map<String,List<String>> |
findRedundantValues(Properties properties)
Finds redundant values from the given Properties object and saves it to a Map.
|
static Map<String,List<String>> |
getMatchedPrefixLists(Properties enProperties)
Finds all keys with the same key prefixes from the given Properties and saves them to a Map
with the prefix as a key and holds a List with the whole keys the starts with the same key
prefix.
|
static List<String> |
getPropertyParameters(String propertyValue)
Finds the property parameters from the given propertyValue.
|
static Properties |
loadProperties(File propertiesFile)
Load a Properties-object from the given File-object.
|
static List<KeyValuePair<String,String>> |
toKeyValuePairs(Properties properties)
Transforms the given
Properties to a list of KeyValuePair's. |
static void |
toProperties(File properties,
File xml,
String comment)
Converts the given xml file to the given properties file.
|
static void |
toProperties(OutputStream properties,
InputStream xml,
String comment)
Converts the given xml InputStream to the given properties OutputStream.
|
static void |
toXml(File properties,
File xml,
String comment,
String encoding)
Converts the given properties file to the given xml file.
|
static void |
toXml(InputStream properties,
OutputStream xml,
String comment,
String encoding)
Converts the given properties InputStream to the given xml OutputStream.
|
public static final String SEARCH_FILE_PATTERN
public static final String[] PROPERTIES_DELIMITERS
public static Map<String,List<String>> findRedundantValues(Properties properties)
properties - The Properties to check.public static Map<String,List<String>> getMatchedPrefixLists(Properties enProperties)
enProperties - the en propertiespublic static List<String> getPropertyParameters(String propertyValue)
propertyValue - the property valuepublic static Properties loadProperties(File propertiesFile) throws IOException
propertiesFile - the properties fileIOException - Signals that an I/O exception has occurred.public static List<KeyValuePair<String,String>> toKeyValuePairs(Properties properties)
Properties to a list of KeyValuePair's.properties - the propertiesKeyValuePair's.public static void toProperties(File properties, File xml, String comment) throws FileNotFoundException, IOException
properties - the properties file. The xml file does not have to exist.xml - the xml file with the properties to convert.comment - the commentFileNotFoundException - the file not found exceptionIOException - Signals that an I/O exception has occurred.public static void toProperties(OutputStream properties, InputStream xml, String comment) throws FileNotFoundException, IOException
properties - the properties file. The xml file does not have to exist.xml - the xml file with the properties to convert.comment - the commentFileNotFoundException - the file not found exceptionIOException - Signals that an I/O exception has occurred.public static void toXml(File properties, File xml, String comment, String encoding) throws FileNotFoundException, IOException
properties - the properties file.xml - the xml file to write in. The xml file does not have to exist.comment - the commentencoding - the encoding for the xml file.FileNotFoundException - the file not found exceptionIOException - Signals that an I/O exception has occurred.public static void toXml(InputStream properties, OutputStream xml, String comment, String encoding) throws FileNotFoundException, IOException
properties - the properties InputStream.xml - the xml OutputStream to write in.comment - the commentencoding - the encoding for the xml file.FileNotFoundException - the file not found exceptionIOException - Signals that an I/O exception has occurred.Copyright © 2015–2017 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.