Kaydet (Commit) 2359e5a0 authored tarafından Giuseppe Castagno's avatar Giuseppe Castagno

tdf#101094 (16) OPTIONS: Options cache removal: MOVE

Change-Id: I7a610003295aa174d655f1e847e6d9a19d84a197
Reviewed-on: https://gerrit.libreoffice.org/27695Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>
üst 1596379b
...@@ -1908,14 +1908,18 @@ uno::Sequence< uno::Any > Content::setPropertyValues( ...@@ -1908,14 +1908,18 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
uno::Reference< ucb::XContentIdentifier > xNewId uno::Reference< ucb::XContentIdentifier > xNewId
= new ::ucbhelper::ContentIdentifier( aNewURL ); = new ::ucbhelper::ContentIdentifier( aNewURL );
NeonUri sourceURI( xIdentifier->getContentIdentifier() );
NeonUri targetURI( xNewId->getContentIdentifier() );
try try
{ {
NeonUri sourceURI( xIdentifier->getContentIdentifier() );
NeonUri targetURI( xNewId->getContentIdentifier() );
targetURI.SetScheme( sourceURI.GetScheme() ); targetURI.SetScheme( sourceURI.GetScheme() );
xResAccess->MOVE( xResAccess->MOVE(
sourceURI.GetPath(), targetURI.GetURI(), false, xEnv ); sourceURI.GetPath(), targetURI.GetURI(), false, xEnv );
aStaticDAVOptionsCache.removeDAVOptions( sourceURI.GetURI() );
aStaticDAVOptionsCache.removeDAVOptions( targetURI.GetURI() );
// @@@ Should check for resources that could not be moved // @@@ Should check for resources that could not be moved
// (due to source access or target overwrite) and send // (due to source access or target overwrite) and send
// this information through the interaction handler. // this information through the interaction handler.
...@@ -1949,6 +1953,8 @@ uno::Sequence< uno::Any > Content::setPropertyValues( ...@@ -1949,6 +1953,8 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
} }
catch ( DAVException const & e ) catch ( DAVException const & e )
{ {
aStaticDAVOptionsCache.removeDAVOptions( sourceURI.GetURI() );
aStaticDAVOptionsCache.removeDAVOptions( targetURI.GetURI() );
// Do not set new title! // Do not set new title!
aNewTitle.clear(); aNewTitle.clear();
...@@ -2578,11 +2584,12 @@ void Content::transfer( ...@@ -2578,11 +2584,12 @@ void Content::transfer(
xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) );
} }
NeonUri sourceURI( rArgs.SourceURL );
NeonUri targetURI( xIdentifier->getContentIdentifier() );
OUString aTargetURI; OUString aTargetURI;
try try
{ {
NeonUri sourceURI( rArgs.SourceURL );
NeonUri targetURI( xIdentifier->getContentIdentifier() );
aTargetURI = targetURI.GetPathBaseNameUnescaped(); aTargetURI = targetURI.GetPathBaseNameUnescaped();
// Check source's and target's URL scheme // Check source's and target's URL scheme
...@@ -2703,6 +2710,8 @@ void Content::transfer( ...@@ -2703,6 +2710,8 @@ void Content::transfer(
rArgs.NameClash rArgs.NameClash
== ucb::NameClash::OVERWRITE, == ucb::NameClash::OVERWRITE,
Environment ); Environment );
aStaticDAVOptionsCache.removeDAVOptions( sourceURI.GetURI() );
aStaticDAVOptionsCache.removeDAVOptions( targetURI.GetURI() );
if ( xSource.is() ) if ( xSource.is() )
{ {
...@@ -2749,10 +2758,14 @@ void Content::transfer( ...@@ -2749,10 +2758,14 @@ void Content::transfer(
} }
catch ( ucb::IllegalIdentifierException const & ) catch ( ucb::IllegalIdentifierException const & )
{ {
aStaticDAVOptionsCache.removeDAVOptions( sourceURI.GetURI() );
aStaticDAVOptionsCache.removeDAVOptions( targetURI.GetURI() );
// queryContent // queryContent
} }
catch ( DAVException const & e ) catch ( DAVException const & e )
{ {
aStaticDAVOptionsCache.removeDAVOptions( sourceURI.GetURI() );
aStaticDAVOptionsCache.removeDAVOptions( targetURI.GetURI() );
// [RFC 2518] - WebDAV // [RFC 2518] - WebDAV
// 412 (Precondition Failed) - The server was unable to maintain // 412 (Precondition Failed) - The server was unable to maintain
// the liveness of the properties listed in the propertybehavior // the liveness of the properties listed in the propertybehavior
......
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