Class FileOutputTool

java.lang.Object
org.codehaus.groovy.tools.groovydoc.FileOutputTool
All Implemented Interfaces:
OutputTool

public class FileOutputTool extends Object implements OutputTool
Writes generated documentation and copied resources to the file system.
  • Constructor Details

    • FileOutputTool

      public FileOutputTool()
  • Method Details

    • makeOutputArea

      public void makeOutputArea(String filename)
      Ensures that the supplied output location exists.
      Specified by:
      makeOutputArea in interface OutputTool
      Parameters:
      filename - the output directory or root path to prepare
    • writeToOutput

      public void writeToOutput(String fileName, String text, String charset) throws Exception
      Writes rendered text to the supplied output file.
      Specified by:
      writeToOutput in interface OutputTool
      Parameters:
      fileName - the file to write
      text - the rendered content
      charset - the character set to use when writing
      Throws:
      Exception - if the output cannot be written
    • copyResource

      public void copyResource(String srcPath, String dstPath) throws IOException
      Copy a resource file (doc-files/, snippet-files/ content) from srcPath to dstPath. Routed through the tool rather than calling Files.copy directly so that alternative tools (notably MockOutputTool) can intercept the side-effect.
      Specified by:
      copyResource in interface OutputTool
      Throws:
      IOException