From 49775a1f4974371fb53c01c2279bbf115c394033 Mon Sep 17 00:00:00 2001 From: r-ca Date: Mon, 8 Jan 2024 11:23:06 +0900 Subject: [PATCH] WIP --- .../nem/lacerta/processor/impl/DocumentProcessorImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java b/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java index 412bad2e..cdb274a7 100644 --- a/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java +++ b/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java @@ -2,6 +2,7 @@ package one.nem.lacerta.processor.impl; import android.graphics.Bitmap; +import java.io.File; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; @@ -56,7 +57,7 @@ public class DocumentProcessorImpl implements DocumentProcessor{ logger.debug("init", "called"); // XMLメタデータの取得/生成 FileManager fileManager = fileManagerFactory.create(documentDetail.getPath().getFullPath()); - if(fileManager.getList().contains(documentDetail.getPath().getFullPath().resolve("meta.xml"))) { + if(documentDetail.getPath().getFullPath().resolve("meta.xml").toFile().exists()) { logger.debug("init", "meta.xml found"); try { xmlMetaModel = xmlMetaParser.parse(new String(Files.readAllBytes(documentDetail.getPath().getFullPath().resolve("meta.xml")))); @@ -77,6 +78,11 @@ public class DocumentProcessorImpl implements DocumentProcessor{ // Save try { + // ファイルの新規作成を行う + File file = documentDetail.getPath().getFullPath().resolve("meta.xml").toFile(); + file.createNewFile(); + + // ファイルに書き込む Files.write(documentDetail.getPath().getFullPath().resolve("meta.xml"), xmlMetaParser.serialize(xmlMetaModel).getBytes()); logger.debug("init", "saved"); } catch (Exception e) {