Class ResourcePropertiesPersister
java.lang.Object
org.springframework.util.DefaultPropertiesPersister
org.springframework.core.io.support.ResourcePropertiesPersister
- All Implemented Interfaces:
PropertiesPersister
Spring-aware subclass of the plain
DefaultPropertiesPersister
,
adding a conditional check for disabled XML support through the shared
"spring.xml.ignore" property.
This is the standard implementation used in Spring's resource support.
- Since:
- 5.3
- Author:
- Juergen Hoeller, Sebastien Deleuze
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ResourcePropertiesPersister
A convenient constant for a defaultResourcePropertiesPersister
instance, as used in Spring's common resource support. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
loadFromXml
(Properties props, InputStream is) Load properties from the given XML InputStream into the given Properties object.void
storeToXml
(Properties props, OutputStream os, String header) Write the contents of the given Properties object to the given XML OutputStream.void
storeToXml
(Properties props, OutputStream os, String header, String encoding) Write the contents of the given Properties object to the given XML OutputStream.Methods inherited from class org.springframework.util.DefaultPropertiesPersister
load, load, store, store
-
Field Details
-
INSTANCE
A convenient constant for a defaultResourcePropertiesPersister
instance, as used in Spring's common resource support.- Since:
- 5.3
-
-
Constructor Details
-
ResourcePropertiesPersister
public ResourcePropertiesPersister()
-
-
Method Details
-
loadFromXml
Description copied from interface:PropertiesPersister
Load properties from the given XML InputStream into the given Properties object.- Specified by:
loadFromXml
in interfacePropertiesPersister
- Overrides:
loadFromXml
in classDefaultPropertiesPersister
- Parameters:
props
- the Properties object to load intois
- the InputStream to load from- Throws:
IOException
- in case of I/O errors- See Also:
-
storeToXml
Description copied from interface:PropertiesPersister
Write the contents of the given Properties object to the given XML OutputStream.- Specified by:
storeToXml
in interfacePropertiesPersister
- Overrides:
storeToXml
in classDefaultPropertiesPersister
- Parameters:
props
- the Properties object to storeos
- the OutputStream to write toheader
- the description of the property list- Throws:
IOException
- in case of I/O errors- See Also:
-
storeToXml
public void storeToXml(Properties props, OutputStream os, String header, String encoding) throws IOException Description copied from interface:PropertiesPersister
Write the contents of the given Properties object to the given XML OutputStream.- Specified by:
storeToXml
in interfacePropertiesPersister
- Overrides:
storeToXml
in classDefaultPropertiesPersister
- Parameters:
props
- the Properties object to storeos
- the OutputStream to write toheader
- the description of the property listencoding
- the encoding to use- Throws:
IOException
- in case of I/O errors- See Also:
-