LibreOffice Module package (master) 1
|
#include <ZipPackage.hxx>
Public Member Functions | |
ZipPackage (css::uno::Reference< css::uno::XComponentContext > xContext) | |
virtual | ~ZipPackage () override |
ZipFile & | getZipFile () |
sal_Int32 | getFormat () const |
sal_Int32 | GetStartKeyGenID () const |
sal_Int32 | GetEncAlgID () const |
sal_Int32 | GetChecksumAlgID () const |
sal_Int32 | GetDefaultDerivedKeySize () const |
rtl::Reference< comphelper::RefCountedMutex > & | GetSharedMutexRef () |
void | ConnectTo (const css::uno::Reference< css::io::XInputStream > &xInStream) |
css::uno::Sequence< sal_Int8 > | GetEncryptionKey () |
virtual void SAL_CALL | initialize (const css::uno::Sequence< css::uno::Any > &aArguments) override |
virtual css::uno::Any SAL_CALL | getByHierarchicalName (const OUString &aName) override |
virtual sal_Bool SAL_CALL | hasByHierarchicalName (const OUString &aName) override |
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL | createInstance () override |
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL | createInstanceWithArguments (const css::uno::Sequence< css::uno::Any > &aArguments) override |
virtual void SAL_CALL | commitChanges () override |
virtual sal_Bool SAL_CALL | hasPendingChanges () override |
virtual css::uno::Sequence< css::util::ElementChange > SAL_CALL | getPendingChanges () override |
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL | getPropertySetInfo () override |
virtual void SAL_CALL | setPropertyValue (const OUString &aPropertyName, const css::uno::Any &aValue) override |
virtual css::uno::Any SAL_CALL | getPropertyValue (const OUString &PropertyName) override |
virtual void SAL_CALL | addPropertyChangeListener (const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override |
virtual void SAL_CALL | removePropertyChangeListener (const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override |
virtual void SAL_CALL | addVetoableChangeListener (const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override |
virtual void SAL_CALL | removeVetoableChangeListener (const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override |
virtual OUString SAL_CALL | getImplementationName () override |
virtual sal_Bool SAL_CALL | supportsService (const OUString &ServiceName) override |
virtual css::uno::Sequence< OUString > SAL_CALL | getSupportedServiceNames () override |
Private Member Functions | |
bool | isLocalFile () const |
void | parseManifest () |
void | parseContentType () |
void | getZipFileContents () |
void | WriteMimetypeMagicFile (ZipOutputStream &aZipOut) |
void | WriteManifest (ZipOutputStream &aZipOut, const ::std::vector< css::uno::Sequence< css::beans::PropertyValue > > &aManList) |
void | WriteContentTypes (ZipOutputStream &aZipOut, const ::std::vector< css::uno::Sequence< css::beans::PropertyValue > > &aManList) |
css::uno::Reference< css::io::XInputStream > | writeTempFile () |
css::uno::Reference< css::io::XActiveDataStreamer > | openOriginalForOutput () |
void | DisconnectFromTargetAndThrowException_Impl (const css::uno::Reference< css::io::XInputStream > &xTempStream) |
Private Attributes | |
rtl::Reference< comphelper::RefCountedMutex > | m_aMutexHolder |
css::uno::Sequence< css::beans::NamedValue > | m_aStorageEncryptionKeys |
css::uno::Sequence< sal_Int8 > | m_aEncryptionKey |
css::uno::Sequence< css::uno::Sequence< css::beans::NamedValue > > | m_aGpgProps |
FolderHash | m_aRecent |
OUString | m_aURL |
sal_Int32 | m_nStartKeyGenerationID |
sal_Int32 | m_nChecksumDigestID |
sal_Int32 | m_nCommonEncryptionID |
bool | m_bHasEncryptedEntries |
bool | m_bHasNonEncryptedEntries |
bool | m_bInconsistent |
bool | m_bForceRecovery |
bool | m_bMediaTypeFallbackUsed |
sal_Int32 | m_nFormat |
bool | m_bAllowRemoveOnInsert |
InitialisationMode | m_eMode |
rtl::Reference< ZipPackageFolder > | m_xRootFolder |
css::uno::Reference< css::io::XStream > | m_xStream |
css::uno::Reference< css::io::XInputStream > | m_xContentStream |
css::uno::Reference< css::io::XSeekable > | m_xContentSeek |
const css::uno::Reference< css::uno::XComponentContext > | m_xContext |
std::optional< ZipFile > | m_pZipFile |
bool | m_bDisableFileSync = false |
Definition at line 60 of file ZipPackage.hxx.
ZipPackage::ZipPackage | ( | css::uno::Reference< css::uno::XComponentContext > | xContext | ) |
Definition at line 138 of file ZipPackage.cxx.
References m_bAllowRemoveOnInsert, m_nFormat, m_nFormat, m_xContext, m_xContext, m_xRootFolder, PACKAGE, and SHA1.
|
overridevirtual |
Definition at line 156 of file ZipPackage.cxx.
|
overridevirtual |
Definition at line 1806 of file ZipPackage.cxx.
|
overridevirtual |
Definition at line 1812 of file ZipPackage.cxx.
|
overridevirtual |
Definition at line 1400 of file ZipPackage.cxx.
References Any, ConnectTo(), comphelper::OStorageHelper::CopyInputToOutput(), DisconnectFromTargetAndThrowException_Impl(), e_IMode_URL, e_IMode_XInputStream, e_IMode_XStream, ucbhelper::Content::executeCommand(), cppu::getCaughtException(), isLocalFile(), m_aMutexHolder, m_aURL, m_bMediaTypeFallbackUsed, m_eMode, m_xContext, m_xStream, THROW_WHERE, u, and writeTempFile().
void ZipPackage::ConnectTo | ( | const css::uno::Reference< css::io::XInputStream > & | xInStream | ) |
Definition at line 1125 of file ZipPackage.cxx.
References m_aMutexHolder, m_pZipFile, m_xContentSeek, m_xContentStream, and m_xContext.
Referenced by commitChanges(), and writeTempFile().
|
overridevirtual |
Definition at line 982 of file ZipPackage.cxx.
References m_bAllowRemoveOnInsert, m_nFormat, and m_xContext.
|
overridevirtual |
Definition at line 988 of file ZipPackage.cxx.
References aArguments, m_bAllowRemoveOnInsert, m_nFormat, and m_xContext.
|
private |
Definition at line 1588 of file ZipPackage.cxx.
References Any, e_IMode_XInputStream, e_IMode_XStream, m_eMode, m_xStream, and THROW_WHERE.
Referenced by commitChanges().
|
overridevirtual |
Definition at line 792 of file ZipPackage.cxx.
References aName, Any, ZipContentInfo::bFolder, ZipPackageFolder::doGetByName(), ZipPackageFolder::getByName(), ZipPackageFolder::hasByName(), m_aRecent, m_xRootFolder, nIndex, ZipContentInfo::pFolder, and THROW_WHERE.
Referenced by parseContentType(), and parseManifest().
|
inline |
Definition at line 126 of file ZipPackage.hxx.
References m_nChecksumDigestID.
Referenced by ZipPackageStream::GetEncryptionData().
|
inline |
Definition at line 127 of file ZipPackage.hxx.
References m_nCommonEncryptionID.
Referenced by ZipPackageStream::GetEncryptionData().
|
inline |
Definition at line 125 of file ZipPackage.hxx.
References m_nCommonEncryptionID.
Referenced by ZipPackageStream::GetEncryptionAlgorithm().
uno::Sequence< sal_Int8 > ZipPackage::GetEncryptionKey | ( | ) |
Definition at line 1616 of file ZipPackage.cxx.
References m_aEncryptionKey, m_aStorageEncryptionKeys, m_nStartKeyGenerationID, PACKAGE_ENCRYPTIONDATA_SHA1CORRECT, PACKAGE_ENCRYPTIONDATA_SHA256UTF8, and THROW_WHERE.
Referenced by ZipPackageStream::GetEncryptionKey(), and writeTempFile().
|
inline |
Definition at line 122 of file ZipPackage.hxx.
References m_nFormat.
Referenced by ZipPackageStream::setPropertyValue().
|
overridevirtual |
Definition at line 1650 of file ZipPackage.cxx.
|
overridevirtual |
Definition at line 1644 of file ZipPackage.cxx.
|
overridevirtual |
Definition at line 1665 of file ZipPackage.cxx.
|
overridevirtual |
Definition at line 1762 of file ZipPackage.cxx.
References Any, ENCRYPTION_ALGORITHMS_PROPERTY, ENCRYPTION_GPG_PROPERTIES, ENCRYPTION_KEY_PROPERTY, comphelper::SequenceAsHashMap::getAsConstNamedValueList(), HAS_ENCRYPTED_ENTRIES_PROPERTY, HAS_NONENCRYPTED_ENTRIES_PROPERTY, IS_INCONSISTENT_PROPERTY, m_aEncryptionKey, m_aGpgProps, m_aStorageEncryptionKeys, m_bHasEncryptedEntries, m_bHasNonEncryptedEntries, m_bInconsistent, m_bMediaTypeFallbackUsed, m_nChecksumDigestID, m_nCommonEncryptionID, m_nStartKeyGenerationID, MEDIATYPE_FALLBACK_USED_PROPERTY, and STORAGE_ENCRYPTION_KEYS_PROPERTY.
|
inline |
Definition at line 129 of file ZipPackage.hxx.
References m_aMutexHolder.
Referenced by ZipPackageStream::getDataStream(), ZipPackageStream::getInputStream(), ZipPackageStream::getPlainRawStream(), ZipPackageStream::getRawData(), ZipPackageStream::getRawStream(), and ZipPackageStream::TryToGetRawFromDataStream().
|
inline |
Definition at line 124 of file ZipPackage.hxx.
References m_nStartKeyGenerationID.
Referenced by ZipPackageStream::getDataStream(), and ZipPackageStream::GetStartKeyGenID().
|
overridevirtual |
Definition at line 1655 of file ZipPackage.cxx.
|
inline |
Definition at line 121 of file ZipPackage.hxx.
References m_pZipFile.
Referenced by ZipPackageStream::getDataStream(), ZipPackageStream::getInputStream(), ZipPackageStream::getPlainRawStream(), ZipPackageStream::getRawData(), and ZipPackageStream::getRawStream().
|
private |
Definition at line 507 of file ZipPackage.cxx.
References ZipContentInfo::bFolder, ZipPackageFolder::doGetByName(), ZipPackageFolder::hasByName(), ZipEnumeration::hasMoreElements(), m_aRecent, m_bAllowRemoveOnInsert, m_bForceRecovery, m_nFormat, m_pZipFile, m_xContext, m_xRootFolder, ZipEnumeration::nextElement(), nIndex, parseContentType(), parseManifest(), ZipContentInfo::pFolder, and ZipEntry::sPath.
Referenced by initialize().
|
overridevirtual |
Definition at line 886 of file ZipPackage.cxx.
References aName, ZipContentInfo::bFolder, ZipPackageFolder::doGetByName(), ZipPackageFolder::hasByName(), m_aRecent, m_xRootFolder, nIndex, and ZipContentInfo::pFolder.
Referenced by parseContentType(), and parseManifest().
|
overridevirtual |
Definition at line 1640 of file ZipPackage.cxx.
|
overridevirtual |
Definition at line 586 of file ZipPackage.cxx.
References aArguments, aCommand, Any, comphelper::OSeekableInputWrapper::CheckSeekableCanWrap(), e_IMode_URL, e_IMode_XInputStream, e_IMode_XStream, Exception, ucbhelper::Content::getPropertyValue(), o3tl::getToken(), getZipFileContents(), m_aMutexHolder, m_aURL, m_bAllowRemoveOnInsert, m_bDisableFileSync, m_bForceRecovery, m_eMode, m_nFormat, m_pZipFile, m_xContentSeek, m_xContentStream, m_xContext, m_xRootFolder, m_xStream, nIndex, OFOPXML_STORAGE_FORMAT_STRING, ucbhelper::Content::openStream(), PACKAGE_STORAGE_FORMAT_STRING, THROW_WHERE, u, xSink, and ZIP_STORAGE_FORMAT_STRING.
|
private |
Definition at line 160 of file ZipPackage.cxx.
References comphelper::isFileUrl(), and m_aURL.
Referenced by commitChanges(), and writeTempFile().
|
private |
Definition at line 1348 of file ZipPackage.cxx.
References Any, e_IMode_URL, Exception, ucbhelper::Content::executeCommand(), m_aURL, m_eMode, m_xContext, ucbhelper::Content::setPropertyValue(), ucbhelper::Content::writeStream(), and xSink.
Referenced by writeTempFile().
|
private |
Definition at line 444 of file ZipPackage.cxx.
References getByHierarchicalName(), hasByHierarchicalName(), m_bForceRecovery, m_nFormat, m_xContext, m_xRootFolder, THROW_WHERE, u, and xSink.
Referenced by getZipFileContents().
|
private |
Definition at line 165 of file ZipPackage.cxx.
References aData, Any, Exception, getByHierarchicalName(), hasByHierarchicalName(), m_aGpgProps, m_bForceRecovery, m_bHasEncryptedEntries, m_bHasNonEncryptedEntries, m_bInconsistent, m_bMediaTypeFallbackUsed, m_nChecksumDigestID, m_nCommonEncryptionID, m_nFormat, m_nStartKeyGenerationID, m_xContext, m_xRootFolder, nCount, ODFVER_012_TEXT, sMediaType, THROW_WHERE, u, and xSink.
Referenced by getZipFileContents().
|
overridevirtual |
Definition at line 1809 of file ZipPackage.cxx.
|
overridevirtual |
Definition at line 1815 of file ZipPackage.cxx.
|
overridevirtual |
Definition at line 1670 of file ZipPackage.cxx.
References ENCRYPTION_ALGORITHMS_PROPERTY, ENCRYPTION_GPG_PROPERTIES, ENCRYPTION_KEY_PROPERTY, HAS_ENCRYPTED_ENTRIES_PROPERTY, HAS_NONENCRYPTED_ENTRIES_PROPERTY, IS_INCONSISTENT_PROPERTY, m_aEncryptionKey, m_aGpgProps, m_aStorageEncryptionKeys, m_nChecksumDigestID, m_nCommonEncryptionID, m_nFormat, m_nStartKeyGenerationID, m_pZipFile, MEDIATYPE_FALLBACK_USED_PROPERTY, STORAGE_ENCRYPTION_KEYS_PROPERTY, and THROW_WHERE.
|
overridevirtual |
Definition at line 1660 of file ZipPackage.cxx.
References cppu::supportsService().
|
private |
Definition at line 1067 of file ZipPackage.cxx.
References ZipOutputEntryBase::closeEntry(), ZipOutputStream::getCurrentDosTime(), ZipOutputStream::getStream(), m_xContext, Name, ZipEntry::nCompressedSize, ZipEntry::nCrc, ZipEntry::nMethod, ZipEntry::nSize, ZipEntry::nTime, PKG_MNFST_FULLPATH, PKG_MNFST_MEDIATYPE, ZipOutputStream::rawCloseEntry(), ZipOutputStream::setEntry(), ZipEntry::sPath, ZipOutputEntry::write(), and ZipOutputStream::writeLOC().
Referenced by writeTempFile().
|
private |
Definition at line 1040 of file ZipPackage.cxx.
References ZipOutputEntryBase::closeEntry(), comphelper::containerToSequence(), ZipOutputStream::getCurrentDosTime(), ZipOutputStream::getStream(), m_xContext, ZipEntry::nCompressedSize, ZipEntry::nCrc, ZipEntry::nMethod, ZipEntry::nSize, ZipEntry::nTime, ZipOutputStream::rawCloseEntry(), ZipOutputStream::setEntry(), ZipEntry::sPath, ZipOutputEntry::write(), and ZipOutputStream::writeLOC().
Referenced by writeTempFile().
|
private |
Definition at line 1002 of file ZipPackage.cxx.
References cppu::getCaughtException(), ZipOutputStream::getCurrentDosTime(), CRC32::getValue(), m_xRootFolder, ZipEntry::nCompressedSize, ZipEntry::nCrc, ZipEntry::nMethod, ZipEntry::nSize, ZipEntry::nTime, OUStringToOString(), ZipOutputStream::rawCloseEntry(), ZipOutputStream::rawWrite(), ZipOutputStream::setEntry(), sMediaType, ZipEntry::sPath, THROW_WHERE, u, CRC32::update(), and ZipOutputStream::writeLOC().
Referenced by writeTempFile().
|
private |
Definition at line 1160 of file ZipPackage.cxx.
References Any, ConnectTo(), e_IMode_URL, e_IMode_XStream, ZipOutputStream::finish(), GetEncryptionKey(), isLocalFile(), m_aGpgProps, m_bDisableFileSync, m_eMode, m_nFormat, m_pZipFile, m_xRootFolder, m_xStream, openOriginalForOutput(), PKG_MNFST_FULLPATH, PKG_MNFST_MEDIATYPE, PKG_MNFST_VERSION, PKG_SIZE_NOENCR_MNFST, sMediaType, THROW_WHERE, u, WriteContentTypes(), WriteManifest(), WriteMimetypeMagicFile(), and xSink.
Referenced by commitChanges().
|
private |
Definition at line 73 of file ZipPackage.hxx.
Referenced by GetEncryptionKey(), getPropertyValue(), and setPropertyValue().
|
private |
Definition at line 74 of file ZipPackage.hxx.
Referenced by getPropertyValue(), parseManifest(), setPropertyValue(), and writeTempFile().
|
private |
Definition at line 70 of file ZipPackage.hxx.
Referenced by commitChanges(), ConnectTo(), GetSharedMutexRef(), and initialize().
|
private |
Definition at line 76 of file ZipPackage.hxx.
Referenced by getByHierarchicalName(), getZipFileContents(), and hasByHierarchicalName().
|
private |
Definition at line 72 of file ZipPackage.hxx.
Referenced by GetEncryptionKey(), getPropertyValue(), and setPropertyValue().
|
private |
Definition at line 77 of file ZipPackage.hxx.
Referenced by commitChanges(), initialize(), isLocalFile(), and openOriginalForOutput().
|
private |
Definition at line 90 of file ZipPackage.hxx.
Referenced by createInstance(), createInstanceWithArguments(), getZipFileContents(), initialize(), and ZipPackage().
|
private |
Definition at line 101 of file ZipPackage.hxx.
Referenced by initialize(), and writeTempFile().
|
private |
Definition at line 86 of file ZipPackage.hxx.
Referenced by getZipFileContents(), initialize(), parseContentType(), and parseManifest().
|
private |
Definition at line 82 of file ZipPackage.hxx.
Referenced by getPropertyValue(), and parseManifest().
|
private |
Definition at line 83 of file ZipPackage.hxx.
Referenced by getPropertyValue(), and parseManifest().
|
private |
Definition at line 85 of file ZipPackage.hxx.
Referenced by getPropertyValue(), and parseManifest().
|
private |
Definition at line 88 of file ZipPackage.hxx.
Referenced by commitChanges(), getPropertyValue(), and parseManifest().
|
private |
Definition at line 92 of file ZipPackage.hxx.
Referenced by commitChanges(), DisconnectFromTargetAndThrowException_Impl(), initialize(), openOriginalForOutput(), and writeTempFile().
|
private |
Definition at line 80 of file ZipPackage.hxx.
Referenced by GetChecksumAlgID(), getPropertyValue(), parseManifest(), and setPropertyValue().
|
private |
Definition at line 81 of file ZipPackage.hxx.
Referenced by GetDefaultDerivedKeySize(), GetEncAlgID(), getPropertyValue(), parseManifest(), and setPropertyValue().
|
private |
Definition at line 89 of file ZipPackage.hxx.
Referenced by createInstance(), createInstanceWithArguments(), getFormat(), getZipFileContents(), initialize(), parseContentType(), parseManifest(), setPropertyValue(), writeTempFile(), and ZipPackage().
|
private |
Definition at line 79 of file ZipPackage.hxx.
Referenced by GetEncryptionKey(), getPropertyValue(), GetStartKeyGenID(), parseManifest(), and setPropertyValue().
|
private |
Definition at line 100 of file ZipPackage.hxx.
Referenced by ConnectTo(), getZipFile(), getZipFileContents(), initialize(), setPropertyValue(), and writeTempFile().
|
private |
Definition at line 97 of file ZipPackage.hxx.
Referenced by ConnectTo(), and initialize().
|
private |
Definition at line 96 of file ZipPackage.hxx.
Referenced by ConnectTo(), and initialize().
|
private |
Definition at line 98 of file ZipPackage.hxx.
Referenced by commitChanges(), ConnectTo(), createInstance(), createInstanceWithArguments(), getZipFileContents(), initialize(), openOriginalForOutput(), parseContentType(), parseManifest(), WriteContentTypes(), WriteManifest(), and ZipPackage().
|
private |
Definition at line 94 of file ZipPackage.hxx.
Referenced by getByHierarchicalName(), getZipFileContents(), hasByHierarchicalName(), initialize(), parseContentType(), parseManifest(), WriteMimetypeMagicFile(), writeTempFile(), and ZipPackage().
|
private |
Definition at line 95 of file ZipPackage.hxx.
Referenced by commitChanges(), DisconnectFromTargetAndThrowException_Impl(), initialize(), and writeTempFile().