public class PropertyUtils
extends java.lang.Object
Constructor and Description |
---|
PropertyUtils()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
static java.util.Properties |
loadOptionalProperties(java.io.File file)
Loads
Properties from a given File . |
static java.util.Properties |
loadOptionalProperties(java.io.InputStream inputStream)
Loads
Properties from a given InputStream . |
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.
As of 3.1.0, please use method
loadOptionalProperties(java.io.File) . 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.
As of 3.1.0, please use method
loadOptionalProperties(java.io.InputStream) . 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.
As of 3.1.0, please use method
loadOptionalProperties(java.net.URL) . 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 static java.util.Properties loadProperties(@Nonnull java.net.URL url)
loadOptionalProperties(java.net.URL)
. 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)
. 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)
. This method
should not be used as it suppresses exceptions silently when loading properties fails.is
- InputStream
@Nonnull public static java.util.Properties loadOptionalProperties(@Nullable java.net.URL url)
Properties
from a given URL
.
If the given URL
is not null
, it is asserted to represent a valid and loadable properties
resource.
url
- The URL
of the properties resource to load or null
.Properties
instance if url
is null
.@Nonnull public static java.util.Properties loadOptionalProperties(@Nullable java.io.File file)
Properties
from a given File
.
If the given File
is not null
, it is asserted to represent a valid and loadable properties
resource.
file
- The File
of the properties resource to load or null
.Properties
instance if file
is null
.@Nonnull public static java.util.Properties loadOptionalProperties(@Nullable java.io.InputStream inputStream)
Properties
from a given InputStream
.
If the given InputStream
is not null
, it is asserted to represent a valid and loadable properties
resource.
inputStream
- The InputStream
of the properties resource to load or null
.Properties
instance if inputStream
is null
.