类 PropertiesUtils
java.lang.Object
cn.taketoday.core.io.PropertiesUtils
Convenient utility methods for loading of
java.util.Properties,
performing standard handling of input streams.
For more configurable properties loading, including the option of a customized encoding, consider using the PropertiesLoaderSupport class.
- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller, Rob Harrop, Sebastien Deleuze, TODAY 2021/10/6 00:00
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static StringcheckPropertiesName(String fileName) Check properties file namestatic voidfillProperties(Map properties, Resource resource) (专用程序包) static voidfillProperties(Properties props, EncodedResource resource, PropertiesPersister persister) Actually load properties from the given EncodedResource into the given Properties instance.static voidfillProperties(Properties props, Resource resource) Fill the given properties from the given resource (in ISO-8859-1 encoding).static PropertiesloadAllProperties(String resourceName) Load all properties from the specified class path resource (in ISO-8859-1 encoding), using the default class loader.static PropertiesloadAllProperties(String resourceName, ClassLoader classLoader) Load all properties from the specified class path resource (in ISO-8859-1 encoding), using the given class loader.static PropertiesloadProperties(EncodedResource resource) Load properties from the given EncodedResource, potentially defining a specific encoding for the properties file.static PropertiesloadProperties(Resource resource) Load properties from the given resource (in ISO-8859-1 encoding).static PropertiesloadProperties(String resource) Load properties from the given resource locationstatic PropertiesConvertStringintoProperties, considering it as properties content.
-
字段详细资料
-
XML_FILE_EXTENSION
- 另请参阅:
-
-
构造器详细资料
-
PropertiesUtils
public PropertiesUtils()
-
-
方法详细资料
-
loadProperties
Load properties from the given EncodedResource, potentially defining a specific encoding for the properties file. -
checkPropertiesName
Check properties file name- 参数:
fileName- Input file name- 返回:
- checked properties file name
-
fillProperties
static void fillProperties(Properties props, EncodedResource resource, PropertiesPersister persister) throws IOException Actually load properties from the given EncodedResource into the given Properties instance.- 参数:
props- the Properties instance to load intoresource- the resource to load frompersister- the PropertiesPersister to use- 抛出:
IOException- in case of I/O errors
-
loadProperties
Load properties from the given resource location- 参数:
resource- the resource to load from- 返回:
- the populated Properties instance
- 抛出:
IOException- if loading failed- 另请参阅:
-
loadProperties
Load properties from the given resource (in ISO-8859-1 encoding).- 参数:
resource- the resource to load from- 返回:
- the populated Properties instance
- 抛出:
IOException- if loading failed- 另请参阅:
-
fillProperties
Fill the given properties from the given resource (in ISO-8859-1 encoding).- 参数:
props- the Properties instance to fillresource- the resource to load from- 抛出:
IOException- if loading failed
-
fillProperties
- 抛出:
IOException
-
loadAllProperties
Load all properties from the specified class path resource (in ISO-8859-1 encoding), using the default class loader.Merges properties if more than one resource of the same name found in the class path.
- 参数:
resourceName- the name of the class path resource- 返回:
- the populated Properties instance
- 抛出:
IOException- if loading failed
-
loadAllProperties
public static Properties loadAllProperties(String resourceName, @Nullable ClassLoader classLoader) throws IOException Load all properties from the specified class path resource (in ISO-8859-1 encoding), using the given class loader.Merges properties if more than one resource of the same name found in the class path.
- 参数:
resourceName- the name of the class path resourceclassLoader- the ClassLoader to use for loading (ornullto use the default class loader)- 返回:
- the populated Properties instance
- 抛出:
IOException- if loading failed
-
parse
ConvertStringintoProperties, considering it as properties content.- 参数:
text- the text to be so converted
-