Kaydet (Commit) 8ff5e67d authored tarafından Giuseppe Castagno's avatar Giuseppe Castagno

tdf#101094 (22): Simplify cache removal: MKCOL, PUT

Change-Id: Id2c9f87e408b6754e17ef3792691d848deabfcd5
Reviewed-on: https://gerrit.libreoffice.org/28056Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>
üst 508f7829
...@@ -2472,23 +2472,21 @@ void Content::insert( ...@@ -2472,23 +2472,21 @@ void Content::insert(
aURL += aEscapedTitle; aURL += aEscapedTitle;
// save the URL to clean cache
OUString aTargetUrl = aURL;
try try
{ {
xResAccess->setURL( aURL ); xResAccess->setURL( aURL );
if ( bCollection ) if ( bCollection )
{ {
aStaticDAVOptionsCache.removeDAVOptions( xResAccess->getURL() );
xResAccess->MKCOL( Environment ); xResAccess->MKCOL( Environment );
aStaticDAVOptionsCache.removeDAVOptions( aTargetUrl );
} }
else else
{ {
xResAccess->PUT( xInputStream, Environment );
// remove options from cache, PUT may change it // remove options from cache, PUT may change it
// it will be refreshed when needed // 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 // no error , set the resourcetype to unknown type
// the resource may have transitioned from NOT FOUND or UNKNOWN to something else // the resource may have transitioned from NOT FOUND or UNKNOWN to something else
...@@ -2499,7 +2497,6 @@ void Content::insert( ...@@ -2499,7 +2497,6 @@ void Content::insert(
} }
catch ( DAVException const & except ) catch ( DAVException const & except )
{ {
aStaticDAVOptionsCache.removeDAVOptions( aTargetUrl );
if ( bCollection ) if ( bCollection )
{ {
if ( except.getStatus() == SC_METHOD_NOT_ALLOWED ) if ( except.getStatus() == SC_METHOD_NOT_ALLOWED )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment