What autogen.sh for an alternative ContentProvider for dav:// scheme?
Giuseppe Castagno
giuseppe.castagno at acca-esse.eu
Thu Aug 27 06:27:29 PDT 2015
On 08/27/2015 01:37 PM, Stephan Bergmann wrote:
> On 08/27/2015 12:35 PM, Giuseppe Castagno wrote:
>> On 08/27/2015 11:45 AM, Stephan Bergmann wrote:
>>> So added support for vnd.sun.star.webdavs to LO 5.1 now,
>>> <https://wiki.documentfoundation.org/index.php?title=ReleaseNotes/5.1&oldid=116154#Core>.
>>>
>>
>> Saw commit [1], probably INetProtocol needs adjusting too.
>
> Don't think so. Since INetURLObject falls back to INetProtocol::Generic
> now, there's rarely need these days to keep adding schemes to
> INetURLObject/INetProtocol. (For example, "dav" and "davs" are not
> there, either.)
Then, while checking for the scheme of a url to determine if it's webdav
or not, in SfxMedium::LockOrigFileOnDemand and SfxMedium::UnlockFile I used:
INetProtocol aProto = GetURLObject().GetProtocol();
if( aProto == INetProtocol::Http || aProto == INetProtocol::Https ||
aProto == INetProtocol::VndSunStarWebdav )
{
// WebDAV !
}
Or is there another way to detect the protocol ?
For example one may be this:
::ucbhelper::Content aContent;
OUString aScheme;
aContent = ::ucbhelper::Content(sURL, xCommandEnv,
comphelper::getProcessComponentContext());
css::uno::Reference< css::ucb::XContentIdentifier > xContId(
aContent.get().is() ? aContent.get()->getIdentifier() : 0 );
if ( xContId.is() )
aScheme = xContId->getContentProviderScheme().toAsciiLowerCase();
if ( aScheme == "http" || aScheme == "https" || aScheme ==
"vnd.sun.star.webdav" )
{
// WebDAV !
}
what's the better?
This is where I got the idea:
http://opengrok.libreoffice.org/xref/core/sfx2/source/doc/docfile.cxx#385
Perhaps another better way?
Thanks
--
Kind Regards,
Giuseppe Castagno aka beppec56
Acca Esse http://www.acca-esse.eu
giuseppe.castagno at acca-esse.eu
More information about the LibreOffice
mailing list