Class UpdateProperties

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

public class UpdateProperties extends Object implements DefaultPlugin
Updates online-mode in server.properties to match the conversion direction.
  • Constructor Details

    • UpdateProperties

      public UpdateProperties()
  • 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 an online/offline conversion was requested.
      Specified by:
      isEnabled in interface DefaultPlugin
      Specified by:
      isEnabled in interface MOOCPlugin
      Parameters:
      ctx - the shared conversion context
      Returns:
      true if this is a conversion operation; 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 online-mode to true for online conversion, otherwise false.
      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