1 package jp.sourceforge.stigmata.command;
7 import java.io.FileWriter;
8 import java.io.IOException;
9 import java.io.PrintWriter;
11 import jp.sourceforge.stigmata.BirthmarkContext;
12 import jp.sourceforge.stigmata.Stigmata;
13 import jp.sourceforge.stigmata.utils.ConfigFileExporter;
17 * @author Haruaki Tamada
20 public class ExportConfigCommand extends AbstractStigmataCommand{
23 public String getCommandString(){
24 return "export-config";
27 public void perform(Stigmata stigmata, BirthmarkContext context, String[] args){
30 if(args == null || args.length == 0){
31 out = new PrintWriter(System.out);
34 if(!args[0].endsWith(".xml")){
35 args[0] = args[0] + ".xml";
37 out = new PrintWriter(new FileWriter(args[0]));
40 new ConfigFileExporter(context.getEnvironment()).export(out);
42 }catch(IOException e){