mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
loadXml, loadXmlInternal実装
This commit is contained in:
parent
3e2a295a22
commit
f3465bcf81
|
@ -211,14 +211,27 @@ public class FileManagerImpl implements FileManager {
|
|||
this.saveBitmapInternal(bitmap);
|
||||
}
|
||||
|
||||
// Internal
|
||||
private Document loadXmlInternal() throws IOException {
|
||||
try {
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
return builder.parse(Files.newInputStream(this.path.toFile().toPath()));
|
||||
} catch (Exception e) {
|
||||
logger.error("loadXmlInternal", e.getMessage());
|
||||
throw new IOException("Failed to load xml");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Document loadXml(String fileName) throws IOException {
|
||||
return null;
|
||||
this.resolve(fileName);
|
||||
return this.loadXmlInternal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Document loadXml() throws IOException {
|
||||
return null;
|
||||
return this.loadXmlInternal();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue
Block a user