mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-22 16:03:15 +00:00
WIP
This commit is contained in:
parent
552f0e42b5
commit
49775a1f49
|
@ -2,6 +2,7 @@ package one.nem.lacerta.processor.impl;
|
||||||
|
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -56,7 +57,7 @@ public class DocumentProcessorImpl implements DocumentProcessor{
|
||||||
logger.debug("init", "called");
|
logger.debug("init", "called");
|
||||||
// XMLメタデータの取得/生成
|
// XMLメタデータの取得/生成
|
||||||
FileManager fileManager = fileManagerFactory.create(documentDetail.getPath().getFullPath());
|
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");
|
logger.debug("init", "meta.xml found");
|
||||||
try {
|
try {
|
||||||
xmlMetaModel = xmlMetaParser.parse(new String(Files.readAllBytes(documentDetail.getPath().getFullPath().resolve("meta.xml"))));
|
xmlMetaModel = xmlMetaParser.parse(new String(Files.readAllBytes(documentDetail.getPath().getFullPath().resolve("meta.xml"))));
|
||||||
|
@ -77,6 +78,11 @@ public class DocumentProcessorImpl implements DocumentProcessor{
|
||||||
|
|
||||||
// Save
|
// Save
|
||||||
try {
|
try {
|
||||||
|
// ファイルの新規作成を行う
|
||||||
|
File file = documentDetail.getPath().getFullPath().resolve("meta.xml").toFile();
|
||||||
|
file.createNewFile();
|
||||||
|
|
||||||
|
// ファイルに書き込む
|
||||||
Files.write(documentDetail.getPath().getFullPath().resolve("meta.xml"), xmlMetaParser.serialize(xmlMetaModel).getBytes());
|
Files.write(documentDetail.getPath().getFullPath().resolve("meta.xml"), xmlMetaParser.serialize(xmlMetaModel).getBytes());
|
||||||
logger.debug("init", "saved");
|
logger.debug("init", "saved");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user