return ret;
}
protected static OpcPackage createPackage(OpcPackage opcPackage) throws Docx4JException {
OpcPackage ret = null;
try {
ret = opcPackage.getClass().newInstance();
} catch (InstantiationException e) {
throw new Docx4JException("InstantiationException duplicating package", e);
} catch (IllegalAccessException e) {
throw new Docx4JException("IllegalAccessException duplicating package", e);
}
// contentType
ret.setContentType(new ContentType(opcPackage.getContentType()));
// partName
ret.setPartName(opcPackage.getPartName());
// relationships
//is done in an another method
// userData
// ret.setUserData(opcPackage.getUserData());
// contentTypeManager
ret.setContentTypeManager(opcPackage.getContentTypeManager());
// customXmlDataStorageParts
ret.getCustomXmlDataStorageParts().putAll(opcPackage.getCustomXmlDataStorageParts());
// docPropsCorePart
ret.setPartShortcut(opcPackage.getDocPropsCorePart(), Namespaces.PROPERTIES_CORE);
// docPropsCustomPart
ret.setPartShortcut(opcPackage.getDocPropsCustomPart(), Namespaces.PROPERTIES_CUSTOM);
// docPropsExtendedPart
ret.setPartShortcut(opcPackage.getDocPropsExtendedPart(), Namespaces.PROPERTIES_EXTENDED);
// externalResources
ret.getExternalResources().putAll(opcPackage.getExternalResources());
// handled
//isn't needed as it is already loaded
// parts
//is done in an another method
// partStore
ret.setSourcePartStore(opcPackage.getSourcePartStore());
return ret;
}