mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
Xmlを保存するInternalメソッド実装
This commit is contained in:
parent
a2eda32183
commit
e0a344bb48
|
@ -170,6 +170,23 @@ public class FileManagerImpl implements FileManager {
|
||||||
return this.setPath(resolvedPath);
|
return this.setPath(resolvedPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Internal
|
||||||
|
private void saveXmlInternal(Document document, String fileName) throws IOException {
|
||||||
|
try {
|
||||||
|
TransformerFactory transformerFactory = TransformerFactory.newInstance();
|
||||||
|
Transformer transformer = transformerFactory.newTransformer();
|
||||||
|
DOMSource source = new DOMSource(document);
|
||||||
|
|
||||||
|
File file = this.path.resolve(fileName).toFile();
|
||||||
|
StreamResult result = new StreamResult(file);
|
||||||
|
|
||||||
|
transformer.transform(source, result);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("saveXmlInternal", e.getMessage());
|
||||||
|
throw new IOException("Failed to save xml");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FileManager saveXml(Document document, String fileName) throws IOException {
|
public FileManager saveXml(Document document, String fileName) throws IOException {
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user