diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-08-27 11:26:18 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-08-27 11:26:18 +0200 |
commit | d3de490437df4c9093f32e97fc185066d64c0f46 (patch) | |
tree | 4007a7f4490ec76a8ced555e85cc9938ada79f4c /ucb | |
parent | 9c3f5324bf155b11dad2036a3556c8afafdb89a9 (diff) |
Add vnd.sun.star.webdavs URL scheme
...as https-equivalent to complement vnd.sun.star.webdav scheme. See the mail
thread starting at
<http://lists.freedesktop.org/archives/libreoffice/2015-August/069929.html>
"What autogen.sh for an alternative ContentProvider for dav:// scheme?" for why
it is considered beneficial to have the WebDAV UCP support---in addition to the
standard pair of http[s] schemes---a non-standard pair of
vnd.sun.star.webdav[s] schemes different from the "accidentally supported"
non-standard pair of dav[s].
Change-Id: I7032aa1ed599f735969cf0163cd9dc121a1fdcb3
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/webdav-neon/webdavcontent.cxx | 8 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/webdavprovider.cxx | 10 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/webdavprovider.hxx | 3 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/webdavcontent.cxx | 8 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/webdavprovider.cxx | 11 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/webdavprovider.hxx | 3 |
6 files changed, 40 insertions, 3 deletions
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index b815bc1685ac..efe31e8f9ad4 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -2516,6 +2516,11 @@ void Content::transfer( sourceURI.SetScheme( OUString( HTTP_URL_SCHEME ) ); } + else if ( aScheme == WEBDAVS_URL_SCHEME ) + { + sourceURI.SetScheme( + OUString( HTTPS_URL_SCHEME ) ); + } else if ( aScheme == DAV_URL_SCHEME ) { sourceURI.SetScheme( @@ -2544,6 +2549,9 @@ void Content::transfer( if ( aScheme == WEBDAV_URL_SCHEME ) targetURI.SetScheme( OUString( HTTP_URL_SCHEME ) ); + else if ( aScheme == WEBDAVS_URL_SCHEME ) + targetURI.SetScheme( + OUString( HTTPS_URL_SCHEME ) ); else if ( aScheme == DAV_URL_SCHEME ) targetURI.SetScheme( OUString( HTTP_URL_SCHEME ) ); diff --git a/ucb/source/ucp/webdav-neon/webdavprovider.cxx b/ucb/source/ucp/webdav-neon/webdavprovider.cxx index 1a8b91be4f17..1f671145aabf 100644 --- a/ucb/source/ucp/webdav-neon/webdavprovider.cxx +++ b/ucb/source/ucp/webdav-neon/webdavprovider.cxx @@ -137,7 +137,8 @@ ContentProvider::queryContent( const OUString aScheme = Identifier->getContentProviderScheme().toAsciiLowerCase(); - if ( aScheme != HTTP_URL_SCHEME && aScheme != HTTPS_URL_SCHEME && aScheme != WEBDAV_URL_SCHEME + if ( aScheme != HTTP_URL_SCHEME && aScheme != HTTPS_URL_SCHEME + && aScheme != WEBDAV_URL_SCHEME && aScheme != WEBDAVS_URL_SCHEME && aScheme != DAV_URL_SCHEME && aScheme != DAVS_URL_SCHEME && aScheme != FTP_URL_SCHEME ) throw ucb::IllegalIdentifierException(); @@ -161,6 +162,13 @@ ContentProvider::queryContent( OUString( HTTP_URL_SCHEME ) ); bNewId = true; } + else if ( aScheme == WEBDAVS_URL_SCHEME ) + { + aURL = aURL.replaceAt( 0, + WEBDAVS_URL_SCHEME_LENGTH, + OUString( HTTPS_URL_SCHEME ) ); + bNewId = true; + } else if ( aScheme == DAV_URL_SCHEME ) { aURL = aURL.replaceAt( 0, diff --git a/ucb/source/ucp/webdav-neon/webdavprovider.hxx b/ucb/source/ucp/webdav-neon/webdavprovider.hxx index da789cf73dd6..dbec74e415fe 100644 --- a/ucb/source/ucp/webdav-neon/webdavprovider.hxx +++ b/ucb/source/ucp/webdav-neon/webdavprovider.hxx @@ -50,6 +50,9 @@ namespace webdav_ucp { #define WEBDAV_URL_SCHEME "vnd.sun.star.webdav" #define WEBDAV_URL_SCHEME_LENGTH 19 +#define WEBDAVS_URL_SCHEME "vnd.sun.star.webdavs" +#define WEBDAVS_URL_SCHEME_LENGTH 20 + #define HTTP_URL_SCHEME "http" #define HTTPS_URL_SCHEME "https" diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx index cf370b7f73c0..b69e81e304a4 100644 --- a/ucb/source/ucp/webdav/webdavcontent.cxx +++ b/ucb/source/ucp/webdav/webdavcontent.cxx @@ -2667,6 +2667,11 @@ void Content::transfer( sourceURI.SetScheme( OUString( HTTP_URL_SCHEME ) ); } + else if ( aScheme == WEBDAVS_URL_SCHEME ) + { + sourceURI.SetScheme( + OUString( HTTPS_URL_SCHEME ) ); + } else if ( aScheme == DAV_URL_SCHEME ) { sourceURI.SetScheme( @@ -2695,6 +2700,9 @@ void Content::transfer( if ( aScheme == WEBDAV_URL_SCHEME ) targetURI.SetScheme( OUString( HTTP_URL_SCHEME ) ); + else if ( aScheme == WEBDAVS_URL_SCHEME ) + targetURI.SetScheme( + OUString( HTTPS_URL_SCHEME ) ); else if ( aScheme == DAV_URL_SCHEME ) targetURI.SetScheme( OUString( HTTP_URL_SCHEME ) ); diff --git a/ucb/source/ucp/webdav/webdavprovider.cxx b/ucb/source/ucp/webdav/webdavprovider.cxx index e485d0e40cca..9d1a71ba6321 100644 --- a/ucb/source/ucp/webdav/webdavprovider.cxx +++ b/ucb/source/ucp/webdav/webdavprovider.cxx @@ -123,8 +123,8 @@ ContentProvider::queryContent( const OUString aScheme = Identifier->getContentProviderScheme().toAsciiLowerCase(); if ( aScheme != HTTP_URL_SCHEME && aScheme != HTTPS_URL_SCHEME && - aScheme != WEBDAV_URL_SCHEME && aScheme != DAV_URL_SCHEME && - aScheme != DAVS_URL_SCHEME ) + aScheme != WEBDAV_URL_SCHEME && aScheme != WEBDAVS_URL_SCHEME && + aScheme != DAV_URL_SCHEME && aScheme != DAVS_URL_SCHEME ) throw ucb::IllegalIdentifierException(); // Normalize URL and create new Id, if nessacary. @@ -147,6 +147,13 @@ ContentProvider::queryContent( OUString( HTTP_URL_SCHEME ) ); bNewId = true; } + else if ( aScheme == WEBDAVS_URL_SCHEME ) + { + aURL = aURL.replaceAt( 0, + WEBDAVS_URL_SCHEME_LENGTH, + OUString( HTTPS_URL_SCHEME ) ); + bNewId = true; + } else if ( aScheme == DAV_URL_SCHEME ) { aURL = aURL.replaceAt( 0, diff --git a/ucb/source/ucp/webdav/webdavprovider.hxx b/ucb/source/ucp/webdav/webdavprovider.hxx index 68ea8532453a..776473bd5600 100644 --- a/ucb/source/ucp/webdav/webdavprovider.hxx +++ b/ucb/source/ucp/webdav/webdavprovider.hxx @@ -42,6 +42,9 @@ namespace http_dav_ucp { #define WEBDAV_URL_SCHEME "vnd.sun.star.webdav" #define WEBDAV_URL_SCHEME_LENGTH 19 +#define WEBDAVS_URL_SCHEME "vnd.sun.star.webdavs" +#define WEBDAVS_URL_SCHEME_LENGTH 20 + #define HTTP_URL_SCHEME "http" #define HTTPS_URL_SCHEME "https" |