4 * License : The MIT License
5 * Copyright(c) 2016 olyutorskii
8 package jp.sourceforge.jindolf.archiver;
10 import java.io.IOException;
11 import java.io.Writer;
12 import java.util.concurrent.Callable;
17 public class DumpXmlTask implements Callable<Void> {
19 private static final String ERR_IO = "出力エラーが発生しました";
20 private static final String ERR_ABORT = "XML出力が中断されました";
23 private final VillageData villageData;
24 private final Writer writer;
29 * @param villageData 村情報
32 public DumpXmlTask(VillageData villageData, Writer writer){
34 this.villageData = villageData;
45 public static String getErrDescription(Throwable cause){
47 if(cause instanceof IOException) desc = ERR_IO;
48 else desc = ERR_ABORT;
56 * @throws IOException 出力エラー
59 public Void call() throws IOException{
61 XmlUtils.dumpVillageData(this.writer, this.villageData);