{
FileInputStream fileIS = new FileInputStream(fileName);
ZipInputStream zipIS = new ZipInputStream(fileIS);
ZipEntry entry;
Document tocDoc = null;
while ((entry = zipIS.getNextEntry()) != null) {
if (entry.getName().compareTo(Package.DefaultPackageFileName) == 0) {
SAXReader reader = new SAXReader();
tocDoc = reader.read(zipIS);
break;
}
}
if (tocDoc == null) {
return Collections.emptyList();
}
List<DocumentReference> result = new ArrayList<DocumentReference>();
Pattern pattern = patternFilter == null ? null : Pattern.compile(patternFilter);
Element filesElement = tocDoc.getRootElement().element("files");
@SuppressWarnings("unchecked")
List<Element> fileElementList = filesElement.elements("file");
for (Element el : fileElementList) {
String docFullName = el.getStringValue();