use of com.sun.enterprise.admin.util.LineTokenReplacer in project Payara by payara.
the class CLICommand method expandManPage.
/**
* Return a man page for this command that has the tokens substituted
* @param r
* @return
*/
public BufferedReader expandManPage(Reader r) {
manpageTokenValues[0] = programOpts.getCommandName();
manpageTokenValues[1] = Environment.getPrefix();
manpageTokenValues[2] = Version.getBriefProductName();
TokenValueSet tvs = new TokenValueSet();
for (int i = 0; i < manpageTokens.length; i++) {
tvs.add(new TokenValue(manpageTokens[i], manpageTokenValues[i], "{", "}"));
}
return new BufferedReader(new LineTokenReplacer(tvs).getReader(r));
}
use of com.sun.enterprise.admin.util.LineTokenReplacer in project Payara by payara.
the class RepositoryManager method generateFromTemplate.
protected void generateFromTemplate(TokenValueSet tokens, File template, File destinationFile) throws IOException {
LineTokenReplacer replacer = new LineTokenReplacer(tokens, "UTF-8");
replacer.replace(template, destinationFile);
}
use of com.sun.enterprise.admin.util.LineTokenReplacer in project Payara by payara.
the class ServicesUtils method tokenReplaceTemplateAtDestination.
static void tokenReplaceTemplateAtDestination(Map<String, String> map, String templatePath, String targetPath) {
final LineTokenReplacer tr = new LineTokenReplacer(map2Set(map));
tr.replace(templatePath, targetPath);
}
Aggregations