Class ApplyCliServerProperties

java.lang.Object
me.pauleff.converter.plugins.ApplyCliServerProperties
All Implemented Interfaces:
DefaultPlugin, MOOCPlugin

public class ApplyCliServerProperties extends Object implements DefaultPlugin
Applies -properties key/value pairs from the CLI to server.properties.
  • Constructor Details

    • ApplyCliServerProperties

      public ApplyCliServerProperties()
  • Method Details

    • metadata

      public PluginMetadata metadata()
      Returns the metadata that identifies and describes this plugin.
      Specified by:
      metadata in interface MOOCPlugin
      Returns:
      the plugin metadata
    • isEnabled

      public boolean isEnabled(PluginContext ctx)
      Returns true when at least one -properties change was provided.
      Specified by:
      isEnabled in interface DefaultPlugin
      Specified by:
      isEnabled in interface MOOCPlugin
      Parameters:
      ctx - the shared conversion context
      Returns:
      true if there are property changes to apply; false otherwise
    • setTargets

      public List<Path> setTargets(PluginContext ctx)
      Returns the server.properties path under the server folder.
      Specified by:
      setTargets in interface MOOCPlugin
      Parameters:
      ctx - the shared conversion context
      Returns:
      a single-element list containing server.properties
    • run

      public void run(PluginContext ctx, List<Path> resolvedExistingTargets) throws IOException
      Writes each CLI property change into the resolved server.properties files.
      Specified by:
      run in interface MOOCPlugin
      Parameters:
      ctx - the shared conversion context
      resolvedExistingTargets - the existing server.properties paths to update
      Throws:
      IOException - if writing properties fails