public class PropertyUtils extends Object
Constructor and Description |
---|
PropertyUtils()
Deprecated.
This is a utility class with only static methods. Don't create instances of it.
|
Modifier and Type | Method and Description |
---|---|
static Properties |
loadOptionalProperties(File file)
Loads
Properties from a File . |
static Properties |
loadOptionalProperties(InputStream inputStream)
Loads
Properties from an InputStream and closes the stream. |
static Properties |
loadOptionalProperties(URL url)
Loads
Properties from a given URL . |
static Properties |
loadProperties(File file)
Deprecated.
use
loadOptionalProperties(java.io.File) instead. This method should not
be used as it suppresses exceptions silently when loading properties fails and returns null
instead of an empty Properties instance when the given File is null . |
static Properties |
loadProperties(InputStream is)
Deprecated.
use
loadOptionalProperties(java.io.InputStream) instead. This method
should not be used as it suppresses exceptions silently when loading properties fails. |
static Properties |
loadProperties(URL url)
Deprecated.
use
loadOptionalProperties(java.net.URL) instead. This method should not
be used as it suppresses exceptions silently when loading properties fails and returns null
instead of an empty Properties instance when the given URL is null . |
@Deprecated public PropertyUtils()
@Deprecated public static Properties loadProperties(@Nonnull URL url)
loadOptionalProperties(java.net.URL)
instead. This method should not
be used as it suppresses exceptions silently when loading properties fails and returns null
instead of an empty Properties
instance when the given URL
is null
.url
- the URL which should be used to load the properties@Deprecated public static Properties loadProperties(@Nonnull File file)
loadOptionalProperties(java.io.File)
instead. This method should not
be used as it suppresses exceptions silently when loading properties fails and returns null
instead of an empty Properties
instance when the given File
is null
.file
- the file from which the properties will be loaded@Deprecated public static Properties loadProperties(@Nullable InputStream is)
loadOptionalProperties(java.io.InputStream)
instead. This method
should not be used as it suppresses exceptions silently when loading properties fails.Properties
from an InputStream
and closes the stream.
In a future release, this will no longer close the stream, so callers
should close the stream themselves.is
- InputStream
@Nonnull public static Properties loadOptionalProperties(@Nullable URL url)
Properties
from a given URL
.
If the given URL
is null
or the properties can't be read, an empty properties object is returned.
url
- the URL
of the properties resource to load or null
Properties
instance if properties fail to load@Nonnull public static Properties loadOptionalProperties(@Nullable File file)
Properties
from a File
.
If the given File
is null
or the properties file can't be read, an empty properties object is
returned.
file
- the File
of the properties resource to load or null
Properties
instance if properties fail to load@Nonnull public static Properties loadOptionalProperties(@Nullable InputStream inputStream)
Properties
from an InputStream
and closes the stream.
If the given InputStream
is null
or the properties can't be read, an empty properties object is
returned. In a future release, this will no longer close the stream, so callers
should close the stream themselves.inputStream
- the properties resource to load or null
Properties
instance if properties fail to loadCopyright © 2002–2020 The Apache Software Foundation. All rights reserved.