public final class PropertiesFileExtensions
extends java.lang.Object
PropertiesFileExtensions.| Constructor and Description |
|---|
PropertiesFileExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Properties |
getLocalPropertiesFromClass(java.lang.Class<?> componentClass,
java.lang.Class<?> defaultClass,
java.util.Locale locale)
Gets the properties.
|
static java.lang.String |
getProjectName()
Gets the project name from the 'project.properties'.
|
static java.util.Map<java.io.File,java.util.Map<java.lang.String,java.util.List<java.lang.String>>> |
getRedundantKeys(java.io.File dirToSearch)
Gets the redundant keys in properties files from the given directory.
|
static java.util.Properties |
loadProperties(java.lang.Class<?> clazz,
java.lang.String name)
Load properties.
|
static java.util.Properties |
loadProperties(java.lang.Class<?> clazz,
java.lang.String packagePath,
java.lang.String fileName)
Load properties.
|
static java.util.Properties |
loadProperties(java.io.File propertiesFile)
Load a Properties-object from the given File-object.
|
static java.util.Properties |
loadProperties(java.lang.String packagePath)
Gives a Properties-object from the given packagepath.
|
static java.util.Properties |
loadProperties(java.lang.String packagePath,
java.lang.String fileName)
Load properties.
|
static <T> java.util.Properties |
loadProperties(T object,
java.lang.String propertiesFilename)
Load
Properties object from the given arguments. |
static java.util.Properties |
loadPropertiesFromClassObject(java.lang.Class<?> clazz,
java.util.Locale locale)
Load the properties file from the given class object.
|
static java.io.File |
newBackupOf(java.io.File file)
Creates a backup file from the given properties file.
|
static java.util.List<java.lang.String> |
removeComments(java.io.File propertiesFile)
Removes the comments from the given properties file.
|
static java.util.Set<java.lang.String> |
resolveAvailableLanguages(java.lang.String bundlepackage,
java.lang.String bundlename)
Resolves all the available languages for the given resource bundle name in the given bundle
package.
|
public static java.util.Properties getLocalPropertiesFromClass(java.lang.Class<?> componentClass,
java.lang.Class<?> defaultClass,
java.util.Locale locale)
throws java.io.IOException
componentClass - the component classdefaultClass - the default classlocale - the localejava.io.IOException - Signals that an I/O exception has occurred.public static java.lang.String getProjectName()
throws java.io.IOException
java.io.IOException - Signals that an I/O exception has occurred.public static java.util.Map<java.io.File,java.util.Map<java.lang.String,java.util.List<java.lang.String>>> getRedundantKeys(java.io.File dirToSearch)
throws java.io.IOException
dirToSearch - the dir to searchjava.io.IOException - Signals that an I/O exception has occurred.public static java.util.Properties loadProperties(java.lang.Class<?> clazz,
java.lang.String name)
throws java.io.IOException
clazz - the clazzname - the package path with the file namejava.io.IOException - Signals that an I/O exception has occurred.public static java.util.Properties loadProperties(java.lang.Class<?> clazz,
java.lang.String packagePath,
java.lang.String fileName)
throws java.io.IOException
clazz - the clazzpackagePath - the package path without the file namefileName - the file namejava.io.IOException - Signals that an I/O exception has occurred.public static java.util.Properties loadProperties(java.io.File propertiesFile)
throws java.io.IOException
propertiesFile - the properties filejava.io.IOException - Signals that an I/O exception has occurred.public static java.util.Properties loadProperties(java.lang.String packagePath)
throws java.io.IOException
packagePath - The package-path and the name from the resource as a String.java.io.IOException - Signals that an I/O exception has occurred.public static java.util.Properties loadProperties(java.lang.String packagePath,
java.lang.String fileName)
throws java.io.IOException
packagePath - the package path without the file namefileName - the file namejava.io.IOException - Signals that an I/O exception has occurred.public static <T> java.util.Properties loadProperties(T object,
java.lang.String propertiesFilename)
throws java.io.IOException
Properties object from the given arguments.T - the generic type of the objectobject - the object for get the package pathpropertiesFilename - the properties filenameProperties or null if the loading process failed.java.io.IOException - Signals that an I/O exception has occurred.public static java.util.Properties loadPropertiesFromClassObject(java.lang.Class<?> clazz,
java.util.Locale locale)
throws java.io.IOException
clazz - the clazzlocale - the localejava.io.IOException - Signals that an I/O exception has occurred.public static java.io.File newBackupOf(java.io.File file)
throws java.io.IOException
file - the filejava.io.IOException - Signals that an I/O exception has occurred.public static java.util.List<java.lang.String> removeComments(java.io.File propertiesFile)
throws java.io.IOException
propertiesFile - the properties filejava.io.IOException - Signals that an I/O exception has occurred.public static java.util.Set<java.lang.String> resolveAvailableLanguages(java.lang.String bundlepackage,
java.lang.String bundlename)
bundlepackage - The package that contains the properties files.bundlename - The name of the resource bundle.