Class TextUtils

java.lang.Object
fi.evolver.script.TextUtils

public class TextUtils extends Object
  • Constructor Details

    • TextUtils

      public TextUtils()
  • Method Details

    • addShellBlock

      public static String addShellBlock(String originalContent, String blockId, String blockContent)

      Adds or updates a script block, replacing existing block contents if found. The block is delimited with comment strings using the blockId param.

      E.g.
           #BLOCK-START this-is-a-block-id #####
           export PATH="$PATH:/new-dir"
           #BLOCK-END this-is-a-block-id #####
       
      Parameters:
      blockId - the identifier used for the block
      blockContent - content to write between block start and end markers