Class LineTokenReplacer

java.lang.Object
com.sun.enterprise.admin.util.LineTokenReplacer

public final class LineTokenReplacer extends Object
  • Constructor Details

    • LineTokenReplacer

      public LineTokenReplacer(TokenValueSet tokens)
      Creates a new instance of TokenReplacer
  • Method Details

    • getReader

      public Reader getReader(Reader in)
      Get a Reader that substitutes the tokens in the content that it returns.
      Parameters:
      in - the content in which tokens are to be substituted
      Returns:
      a Reader that returns the substituted content
    • replace

      public void replace(File inputFile, File outputFile) throws IllegalStateException
      Converts inputFile to outputFile with the following rules:
      • Both files are encoded with UTF-8
      • Line endings are replaced by System.lineSeparator()
      • Tokens from constructor are resolved
      Parameters:
      inputFile -
      outputFile -
      Throws:
      IllegalStateException - if conversion fails for any reason
    • replace

      public void replace(String inputFileName, String outputFileName)