ucb: webdav-curl: tdf#101094 (22): Simplify cache removal: MKCOL, PUT
[ port of commit 8ff5e67dea29d9ceb100a67a69f6deb4c6f18e13 ]
Change-Id: If24272566bfb5fba32b9df9bd0f8e1c7fe18c585
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123475
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
diff --git a/ucb/source/ucp/webdav-curl/webdavcontent.cxx b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
index 212c873..876a23b 100644
--- a/ucb/source/ucp/webdav-curl/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
@@ -2485,23 +2485,21 @@ void Content::insert(
aURL += aEscapedTitle;
// save the URL to clean cache
OUString aTargetUrl = aURL;
try
{
xResAccess->setURL( aURL );
if ( bCollection )
{
aStaticDAVOptionsCache.removeDAVOptions( xResAccess->getURL() );
xResAccess->MKCOL( Environment );
aStaticDAVOptionsCache.removeDAVOptions( aTargetUrl );
}
else
{
xResAccess->PUT( xInputStream, Environment );
// remove options from cache, PUT may change it
// it will be refreshed when needed
aStaticDAVOptionsCache.removeDAVOptions( aTargetUrl );
aStaticDAVOptionsCache.removeDAVOptions( xResAccess->getURL() );
xResAccess->PUT( xInputStream, Environment );
}
// no error , set the resourcetype to unknown type
// the resource may have transitioned from NOT FOUND or UNKNOWN to something else
@@ -2512,7 +2510,6 @@ void Content::insert(
}
catch ( DAVException const & except )
{
aStaticDAVOptionsCache.removeDAVOptions( aTargetUrl );
if ( bCollection )
{
if ( except.getStatus() == SC_METHOD_NOT_ALLOWED )