diff --git a/source/src/main/java/one/nem/lacerta/source/file/FileManager.java b/source/src/main/java/one/nem/lacerta/source/file/FileManager.java index 14f83970..e7c04605 100644 --- a/source/src/main/java/one/nem/lacerta/source/file/FileManager.java +++ b/source/src/main/java/one/nem/lacerta/source/file/FileManager.java @@ -2,6 +2,8 @@ package one.nem.lacerta.source.file; import android.graphics.Bitmap; +import org.w3c.dom.Document; + import java.io.File; import java.nio.file.Path; import java.util.List; @@ -32,6 +34,9 @@ public interface FileManager { void saveText(String text, String fileName); void saveText(String text, Path path); + void saveDocument(Document document, String fileName); + void saveDocument(Document document, Path path); + boolean isExist(Path path); boolean isExist(String fileName); diff --git a/source/src/main/java/one/nem/lacerta/source/file/impl/FileManagerImpl.java b/source/src/main/java/one/nem/lacerta/source/file/impl/FileManagerImpl.java index cd442e92..914cb266 100644 --- a/source/src/main/java/one/nem/lacerta/source/file/impl/FileManagerImpl.java +++ b/source/src/main/java/one/nem/lacerta/source/file/impl/FileManagerImpl.java @@ -2,6 +2,8 @@ package one.nem.lacerta.source.file.impl; import android.graphics.Bitmap; +import org.w3c.dom.Document; + import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -11,6 +13,10 @@ import java.nio.file.Path; import java.util.ArrayList; import java.util.List; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; + import dagger.assisted.Assisted; import dagger.assisted.AssistedInject; import one.nem.lacerta.source.file.FileManager; @@ -217,6 +223,22 @@ public class FileManagerImpl implements FileManager { } } + @Override + public void saveDocument(Document document, String fileName) { + try { + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + Transformer transformer = transformerFactory.newTransformer(); + DOMSource source = new DOMSource(document); + File file = createFile(fileName); + + } + } + + @Override + public void saveDocument(Document document, Path path) { + + } + @Override public boolean isExist(Path path) { logger.debug("isExist", "called");