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.PropertiesloadOptionalProperties(java.io.File file)LoadsPropertiesfrom a givenFile.static java.util.PropertiesloadOptionalProperties(java.io.InputStream inputStream)LoadsPropertiesfrom a givenInputStream.static java.util.PropertiesloadOptionalProperties(java.net.URL url)LoadsPropertiesfrom a givenURL.static java.util.PropertiesloadProperties(java.io.File file)Deprecated.As of 3.1.0, please use methodloadOptionalProperties(java.io.File).static java.util.PropertiesloadProperties(java.io.InputStream is)Deprecated.As of 3.1.0, please use methodloadOptionalProperties(java.io.InputStream).static java.util.PropertiesloadProperties(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 returnsnullinstead of an emptyPropertiesinstance when the givenURLisnull.- 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 returnsnullinstead of an emptyPropertiesinstance when the givenFileisnull.- 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)LoadsPropertiesfrom a givenURL.If the given
URLis notnull, it is asserted to represent a valid and loadable properties resource.- Parameters:
url- TheURLof the properties resource to load ornull.- Returns:
- The loaded properties or an empty
Propertiesinstance ifurlisnull. - Since:
- 3.1.0
-
loadOptionalProperties
@Nonnull public static java.util.Properties loadOptionalProperties(@Nullable java.io.File file)LoadsPropertiesfrom a givenFile.If the given
Fileis notnull, it is asserted to represent a valid and loadable properties resource.- Parameters:
file- TheFileof the properties resource to load ornull.- Returns:
- The loaded properties or an empty
Propertiesinstance iffileisnull. - Since:
- 3.1.0
-
loadOptionalProperties
@Nonnull public static java.util.Properties loadOptionalProperties(@Nullable java.io.InputStream inputStream)LoadsPropertiesfrom a givenInputStream.If the given
InputStreamis notnull, it is asserted to represent a valid and loadable properties resource.- Parameters:
inputStream- TheInputStreamof the properties resource to load ornull.- Returns:
- The loaded properties or an empty
Propertiesinstance ifinputStreamisnull. - Since:
- 3.1.0
-
-