Class WritingStrategy.WritePartStrategy

    • Constructor Detail

      • WritePartStrategy

        public WritePartStrategy​(String marker)
    • Method Detail

      • write

        public void write​(@Nonnull
                          File output,
                          @Nonnull
                          String content,
                          @Nonnull
                          String versionComment)
                   throws IOException
        Replaces the lines between the first line with marker and the second line with the marker with the content. The first line should contain a version comment that is replaced by the new version comment. It is an error if the marker is not exactly twice in the output file.
        Specified by:
        write in interface WritingStrategy
        Parameters:
        output - the file to write to, has to exist
        content - the content to write
        versionComment - the version comment to write
        Throws:
        IOException - if the file cannot be read or written