*
* @throws Exception
*/
protected final void run(String[] args) throws Exception {
CommandProcessor options = new CommandProcessor();
options.register(true, "-sourcepath").setDefault(CURRENT_DIRECTORY);
options.register(true, "-d").setDefault(CURRENT_DIRECTORY);
options.register(true, "-extension").setDefault("");
options.register(true, "-verbose").setDefault("false");
registerOptions(options);
String[] inputs = options.setFrom(args);
_sourceDir = new File(options.getValue("-sourcepath"));
_destinationDir = new File(options.getValue("-d"));
verbose = "true".equalsIgnoreCase(options.getValue("-verbose"));
for (String path : inputs) {
path = path.replace(File.separatorChar, FORWARD_SLASH);
InputStream fin = getInputStream(_sourceDir, path);
if (fin == null) {
continue;
}
File outFile = new File(_destinationDir, suffix(path, options.getValue("-extension")));
FileOutputStream fout = createOutput(outFile);
if (fout == null) {
continue;
}
PrintStream out = new PrintStream(fout);