Class FileAppender

  • All Implemented Interfaces:
    WildFlyPackageTask

    public class FileAppender
    extends java.lang.Object
    implements WildFlyPackageTask
    Task to append content to the `target` file whefre it matches the matcher pattern. If `allMatches` is set to false only the first match will be used. The lines will be added after the first line of the target file that matches the `match` configuration If you need to append some content to the matching line you can set it using `add-to-matching-line`. The lines to be added can be provided either via a file or via a list of lines. You can `ignore` the fact that the target file doesn't exist.
    Author:
    Emmanuel Hugonnet
    • Constructor Detail

      • FileAppender

        public FileAppender()
    • Method Detail

      • setTarget

        public void setTarget​(java.lang.String target)
      • getMatch

        public java.util.regex.Pattern getMatch()
      • setMatch

        public void setMatch​(java.lang.String match)
      • addLine

        public void addLine​(java.lang.String line)
      • isIgnore

        public boolean isIgnore()
      • setIgnore

        public void setIgnore​(boolean ignore)
      • setSource

        public void setSource​(java.lang.String src)
      • setAddToMatchingLine

        public void setAddToMatchingLine​(java.lang.String addToMatchingLine)
      • setAllMatches

        public void setAllMatches​(boolean allMatches)
      • execute

        public void execute​(WfInstallPlugin plugin,
                            org.jboss.galleon.runtime.PackageRuntime pkg)
                     throws org.jboss.galleon.ProvisioningException
        Specified by:
        execute in interface WildFlyPackageTask
        Throws:
        org.jboss.galleon.ProvisioningException