Package org.apache.maven.shared.utils
Class PropertyUtils
java.lang.Object
org.apache.maven.shared.utils.PropertyUtils
Static utility methods for loading properties.
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.This is a utility class with only static methods. -
Method Summary
Modifier and TypeMethodDescriptionstatic PropertiesloadOptionalProperties(File file) LoadsPropertiesfrom aFile.static PropertiesloadOptionalProperties(InputStream inputStream) LoadsPropertiesfrom anInputStreamand closes the stream.static PropertiesLoadsPropertiesfrom a givenURL.static PropertiesloadProperties(File file) Deprecated.useloadOptionalProperties(java.io.File)instead.static PropertiesDeprecated.useloadOptionalProperties(java.io.InputStream)instead.static PropertiesloadProperties(URL url) Deprecated.useloadOptionalProperties(java.net.URL)instead.
-
Constructor Details
-
PropertyUtils
Deprecated.This is a utility class with only static methods. Don't create instances of it.The constructor.
-
-
Method Details
-
loadProperties
Deprecated.useloadOptionalProperties(java.net.URL)instead. 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.useloadOptionalProperties(java.io.File)instead. 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.useloadOptionalProperties(java.io.InputStream)instead. This method should not be used as it suppresses exceptions silently when loading properties fails.LoadsPropertiesfrom anInputStreamand closes the stream. In a future release, this will no longer close the stream, so callers should close the stream themselves.- Parameters:
is-InputStream- Returns:
- the loaded properties
-
loadOptionalProperties
LoadsPropertiesfrom a givenURL.If the given
URLisnullor the properties can't be read, an empty properties object is returned.- Parameters:
url- theURLof the properties resource to load ornull- Returns:
- the loaded properties or an empty
Propertiesinstance if properties fail to load - Since:
- 3.1.0
-
loadOptionalProperties
LoadsPropertiesfrom aFile.If the given
Fileisnullor the properties file can't be read, an empty properties object is returned.- Parameters:
file- theFileof the properties resource to load ornull- Returns:
- the loaded properties or an empty
Propertiesinstance if properties fail to load - Since:
- 3.1.0
-
loadOptionalProperties
LoadsPropertiesfrom anInputStreamand closes the stream. If the givenInputStreamisnullor 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.- Parameters:
inputStream- the properties resource to load ornull- Returns:
- the loaded properties or an empty
Propertiesinstance if properties fail to load - Since:
- 3.1.0
-