close処理修正

This commit is contained in:
r-ca 2024-01-09 14:03:29 +09:00
parent 7951bef6e0
commit e8804e8f84
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9
2 changed files with 10 additions and 12 deletions

View File

@ -18,7 +18,7 @@ public interface DocumentProcessor {
Bitmap getPageAtIndex(int index); Bitmap getPageAtIndex(int index);
int getPageCount(); int getPageCount();
void close(); void close() throws Exception;
void init() throws Exception; // TODO-rca: 例外処理 void init() throws Exception; // TODO-rca: 例外処理
} }

View File

@ -148,18 +148,16 @@ public class DocumentProcessorImpl implements DocumentProcessor{
} }
@Override @Override
public void close() { public void close() throws Exception{
logger.debug("close", "called"); logger.debug("close", "called");
// TODO-rca: ここでxmlファイルを保存する if (this.fileManager.isExist("meta.xml")) {
this.fileManager.backRootDir(); try {
this.fileManager.createFile("meta.xml").saveXml(xmlMetaParser.serialize(xmlMetaModel));
try { logger.debug("close", "meta.xml saved");
this.fileManager.saveDocument(xmlMetaParser.serialize(xmlMetaModel), "meta.xml"); } catch (Exception e) {
logger.debug("close", "meta.xml saved"); logger.error("close", "meta.xml save failed");
} catch (Exception e) { logger.trace("close", e.getMessage());
logger.error("close", "meta.xml save failed"); }
logger.trace("close", e.getMessage());
} }
logger.info("close", "finished");
} }
} }