Methods Summary |
---|
private com.sun.enterprise.admin.util.TokenValue | getTokenValue(java.lang.String line)
final String delim = "=";
final StringTokenizer parser = new StringTokenizer(line, delim);
final String[] output = new String[2];
int i = 0;
while(parser.hasMoreTokens()) {
output[i++] = parser.nextToken();
}
final String DELIM = "%%%";
TokenValue tv = new TokenValue(output[0], output[1], DELIM);
return ( tv );
|
private com.sun.enterprise.admin.util.TokenValueSet | getTokensFromFile(java.lang.String fileName)
final TokenValueSet tokens = new TokenValueSet();
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(fileName));
String line = null;
while ((line = reader.readLine()) != null) {
final TokenValue tv = getTokenValue(line);
tokens.add(tv);
}
reader.close();
reader = null;
}
catch(Exception e) {
e.printStackTrace();
if (reader != null) {
try {
reader.close();
} catch (Exception ex) {}
}
}
return tokens;
|
public static void | main(java.lang.String[] args)
int length = args.length;
if (length < 2) {
usage();
System.exit(1);
}
final String tokensFile = args[0];
final String fromFile = args[1];
final String toFile = fromFile + ".out";
new TokenReplacementTester(tokensFile, fromFile, toFile);
|
private static void | usage()
System.out.println("java TokenReplacementTester <tokens-file> <template-file>");
|