Interface PropertiesManager
- All Known Implementing Classes:
JdkPropertiesManager, YmlPropertiesManager
public interface PropertiesManager
Interface for properties managers implementations.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanisExtensionSupport(String extension) Determinate if manager support resource by file extension.load(InputStream in) Load properties.default Propertiesload(InputStream in, Charset charset) Load properties using the given character set.voidsave(Properties properties, OutputStream out, String comments) Store propertiesdefault voidsave(Properties properties, OutputStream out, String comments, Charset charset) Store properties using the given character set.
-
Field Details
-
DEFAULT_MANAGER_EXTENSION
- See Also:
-
-
Method Details
-
isExtensionSupport
Determinate if manager support resource by file extension.- Parameters:
extension- file extension- Returns:
- true if extension is supported
-
load
Load properties.- Parameters:
in- input stream of properties resource- Returns:
- a properties
- Throws:
IOException- in case of IO problems
-
load
Load properties using the given character set.- Parameters:
in- input stream of properties resourcecharset- the character set the resource is encoded in- Returns:
- a properties
- Throws:
IOException- in case of IO problemsUnsupportedOperationException- if the manager cannot choose the character set- Since:
- 1.4.0
-
save
Store properties- Parameters:
properties- properties to storeout- output stream of properties resourcecomments- a comments added to output resource- Throws:
IOException- in case of IO problems
-
save
default void save(Properties properties, OutputStream out, String comments, Charset charset) throws IOException Store properties using the given character set.- Parameters:
properties- properties to storeout- output stream of properties resourcecomments- a comments added to output resourcecharset- the character set to encode the resource in- Throws:
IOException- in case of IO problemsUnsupportedOperationException- if the manager cannot choose the character set- Since:
- 1.4.0
-