1 package jp.sourceforge.stigmata.command;
3 import java.io.FileWriter;
4 import java.io.IOException;
5 import java.io.PrintWriter;
7 import jp.sourceforge.stigmata.BirthmarkContext;
8 import jp.sourceforge.stigmata.Stigmata;
9 import jp.sourceforge.stigmata.utils.ConfigFileExporter;
13 * @author Haruaki Tamada
15 public class ExportConfigCommand extends AbstractStigmataCommand{
18 public String getCommandString(){
19 return "export-config";
23 public void perform(Stigmata stigmata, BirthmarkContext context, String[] args){
26 if(args == null || args.length == 0){
27 out = new PrintWriter(System.out);
30 if(!args[0].endsWith(".xml")){
31 args[0] = args[0] + ".xml";
33 out = new PrintWriter(new FileWriter(args[0]));
36 new ConfigFileExporter(context.getEnvironment()).export(out);
38 }catch(IOException e){