public class PropertyUtils
extends java.lang.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 java.util.Properties |
loadOptionalProperties(java.io.File file)
Loads
Properties from a File . |
static java.util.Properties |
loadOptionalProperties(java.io.InputStream inputStream)
Loads
Properties from an InputStream and closes the stream. |
static java.util.Properties |
loadOptionalProperties(java.net.URL url)
Loads
Properties from a given URL . |
static java.util.Properties |
loadProperties(java.io.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 java.util.Properties |
loadProperties(java.io.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 java.util.Properties |
loadProperties(java.net.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 java.util.Properties loadProperties(@Nonnull java.net.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 java.util.Properties loadProperties(@Nonnull java.io.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 java.util.Properties loadProperties(@Nullable java.io.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 java.util.Properties loadOptionalProperties(@Nullable java.net.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 java.util.Properties loadOptionalProperties(@Nullable java.io.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 java.util.Properties loadOptionalProperties(@Nullable java.io.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 load