private Map<String, OdfFileEntry> getSubDirectoryEntries(OdfPackage destinationPackage, String directory) {
directory = normalizeDirectoryPath(directory);
Map<String, OdfFileEntry> subEntries = new HashMap<String, OdfFileEntry>();
Map<String, OdfFileEntry> allEntries = getManifestEntries();
Set<String> rootEntryNameSet = getFilePaths();
ManifestElement manifestEle = destinationPackage.getManifestDom().getRootElement();
for (String entryName : rootEntryNameSet) {
if (entryName.startsWith(directory)) {
String newEntryName = entryName.substring(directory.length());
if (newEntryName.length() == 0) {
newEntryName = SLASH;
}
OdfFileEntry srcFileEntry = allEntries.get(entryName);
OdfFileEntry newFileEntry = new OdfFileEntry(manifestEle.newFileEntryElement(newEntryName, srcFileEntry.getMediaTypeString()));
newFileEntry.setEncryptionData(srcFileEntry.getEncryptionData());
newFileEntry.setSize(srcFileEntry.getSize());
subEntries.put(entryName, newFileEntry);
}
}