Class UnixShellScriptFileHeader

java.lang.Object
io.wcm.devops.conga.generator.plugins.fileheader.AbstractFileHeader
io.wcm.devops.conga.generator.plugins.fileheader.UnixShellScriptFileHeader
All Implemented Interfaces:
FileHeaderPlugin, FilePlugin<FileHeaderContext,Void>, Plugin

public final class UnixShellScriptFileHeader extends AbstractFileHeader
Adds file headers to Unix script files (esp. Bash).
  • Field Details

  • Constructor Details

    • UnixShellScriptFileHeader

      public UnixShellScriptFileHeader()
  • Method Details

    • getName

      public String getName()
      Returns:
      Plugin name to be referenced in definition file
    • accepts

      public boolean accepts(FileContext file, FileHeaderContext context)
      Description copied from interface: FilePlugin
      Checks if the plugin can be applied to the given file.
      Parameters:
      file - Context file
      context - Context objects
      Returns:
      true when the plugin can be applied to the given file.
    • getCommentLinePrefix

      protected String getCommentLinePrefix()
      Overrides:
      getCommentLinePrefix in class AbstractFileHeader
    • getBlockSuffix

      protected String getBlockSuffix()
      Overrides:
      getBlockSuffix in class AbstractFileHeader
    • getInsertPosition

      protected int getInsertPosition(String content)
      Overrides:
      getInsertPosition in class AbstractFileHeader
    • extract

      public FileHeaderContext extract(FileContext file)
      Description copied from interface: FileHeaderPlugin
      Extract comment lines from file header.
      Parameters:
      file - Context file
      Returns:
      File header context with comment lines. Returns null if extraction not possible or no comments present.