Interface PropertiesManager

All Known Implementing Classes:
JdkPropertiesManager, YmlPropertiesManager

public interface PropertiesManager
Interface for properties managers implementations.
  • Field Details

  • Method Details

    • isExtensionSupport

      boolean isExtensionSupport(String extension)
      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

      default Properties load(InputStream in, Charset charset) throws IOException
      Load properties using the given character set.
      Parameters:
      in - input stream of properties resource
      charset - the character set the resource is encoded in
      Returns:
      a properties
      Throws:
      IOException - in case of IO problems
      UnsupportedOperationException - if the manager cannot choose the character set
      Since:
      1.4.0
    • save

      void save(Properties properties, OutputStream out, String comments) throws IOException
      Store properties
      Parameters:
      properties - properties to store
      out - output stream of properties resource
      comments - 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 store
      out - output stream of properties resource
      comments - a comments added to output resource
      charset - the character set to encode the resource in
      Throws:
      IOException - in case of IO problems
      UnsupportedOperationException - if the manager cannot choose the character set
      Since:
      1.4.0