use of com.xenoage.utils.xml.XmlReader in project Zong by Xenoage.
the class CompressedFileInput method readRootFilePath.
@NonNull
private String readRootFilePath(XmlReader containerReader) throws IOException {
XmlReader r = containerReader;
// root element
r.openNextChildElement();
while (r.openNextChildElement()) {
if (r.getElementName().equals("rootfiles")) {
// rootfiles element
while (r.openNextChildElement()) {
if (r.getElementName().equals("rootfile")) {
// rootfile element
String fullPath = r.getAttribute("full-path");
if (fullPath == null)
throw new IOException("full-path of rootfile not found");
return fullPath;
}
r.closeElement();
}
}
r.closeElement();
}
throw new IOException("rootfile not found");
}
Aggregations