Package org.apache.maven.shared.utils
Class PropertyUtils
- java.lang.Object
-
- org.apache.maven.shared.utils.PropertyUtils
-
public class PropertyUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description PropertyUtils()
The constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.util.Properties
loadOptionalProperties(java.io.File file)
LoadsProperties
from a givenFile
.static java.util.Properties
loadOptionalProperties(java.io.InputStream inputStream)
LoadsProperties
from a givenInputStream
.static java.util.Properties
loadOptionalProperties(java.net.URL url)
LoadsProperties
from a givenURL
.static java.util.Properties
loadProperties(java.io.File file)
Deprecated.As of 3.1.0, please use methodloadOptionalProperties(java.io.File)
.static java.util.Properties
loadProperties(java.io.InputStream is)
Deprecated.As of 3.1.0, please use methodloadOptionalProperties(java.io.InputStream)
.static java.util.Properties
loadProperties(java.net.URL url)
Deprecated.As of 3.1.0, please use methodloadOptionalProperties(java.net.URL)
.
-
-
-
Method Detail
-
loadProperties
@Deprecated public static java.util.Properties loadProperties(@Nonnull java.net.URL url)
Deprecated.As of 3.1.0, please use methodloadOptionalProperties(java.net.URL)
. This method should not be used as it suppresses exceptions silently when loading properties fails and returnsnull
instead of an emptyProperties
instance when the givenURL
isnull
.- Parameters:
url
- The URL which should be used to load the properties.- Returns:
- The loaded properties.
-
loadProperties
@Deprecated public static java.util.Properties loadProperties(@Nonnull java.io.File file)
Deprecated.As of 3.1.0, please use methodloadOptionalProperties(java.io.File)
. This method should not be used as it suppresses exceptions silently when loading properties fails and returnsnull
instead of an emptyProperties
instance when the givenFile
isnull
.- Parameters:
file
- The file from which the properties will be loaded.- Returns:
- The loaded properties.
-
loadProperties
@Deprecated public static java.util.Properties loadProperties(@Nullable java.io.InputStream is)
Deprecated.As of 3.1.0, please use methodloadOptionalProperties(java.io.InputStream)
. This method should not be used as it suppresses exceptions silently when loading properties fails.- Parameters:
is
-InputStream
- Returns:
- The loaded properties.
-
loadOptionalProperties
@Nonnull public static java.util.Properties loadOptionalProperties(@Nullable java.net.URL url)
LoadsProperties
from a givenURL
.If the given
URL
is notnull
, it is asserted to represent a valid and loadable properties resource.- Parameters:
url
- TheURL
of the properties resource to load ornull
.- Returns:
- The loaded properties or an empty
Properties
instance ifurl
isnull
. - Since:
- 3.1.0
-
loadOptionalProperties
@Nonnull public static java.util.Properties loadOptionalProperties(@Nullable java.io.File file)
LoadsProperties
from a givenFile
.If the given
File
is notnull
, it is asserted to represent a valid and loadable properties resource.- Parameters:
file
- TheFile
of the properties resource to load ornull
.- Returns:
- The loaded properties or an empty
Properties
instance iffile
isnull
. - Since:
- 3.1.0
-
loadOptionalProperties
@Nonnull public static java.util.Properties loadOptionalProperties(@Nullable java.io.InputStream inputStream)
LoadsProperties
from a givenInputStream
.If the given
InputStream
is notnull
, it is asserted to represent a valid and loadable properties resource.- Parameters:
inputStream
- TheInputStream
of the properties resource to load ornull
.- Returns:
- The loaded properties or an empty
Properties
instance ifinputStream
isnull
. - Since:
- 3.1.0
-
-