diff options
author | Ariel Constenla-Haile <arielch@apache.org> | 2013-03-24 12:23:39 +0000 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-08-15 16:55:24 +0200 |
commit | 7165b05968ed7d6a52986382877e82e09f7150aa (patch) | |
tree | d8d2531a04930dbc01b4eaedcba627b857e50126 /ucb | |
parent | 3d737afda8a5bdc12254d1379300ef09a47164c9 (diff) |
i121946 - Use enums to identify WebDAV/HTTP methods
(cherry picked from commit 122e10cfd23b379b97e2d8ec002e7f0562ebd6f7)
Conflicts:
extensions/source/update/feed/updatefeed.cxx
offapi/com/sun/star/ucb/makefile.mk
offapi/type_reference/typelibrary_history.txt
offapi/type_reference/types.rdb
ucb/source/ucp/webdav/DAVResourceAccess.cxx
ucb/source/ucp/webdav/DAVResourceAccess.hxx
plus headerize.pl
(Would be an incompatible API CHANGE if we had not unpublished
XWebDAVCommandEnvironment with 78cca63070ae6cf82b45ec3bc75fafa2db31a7f2 "Revert
publishing of lots of UNO types.")
Change-Id: I153e394a194d0fcad29d3e3b27d5b24f7c259fc4
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/webdav/DAVResourceAccess.cxx | 48 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/DAVResourceAccess.hxx | 5 |
2 files changed, 25 insertions, 28 deletions
diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx index 9c1d3e93425d..088b868b2fd2 100644 --- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx +++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx @@ -186,8 +186,7 @@ void DAVResourceAccess::PROPFIND( getUserRequestHeaders( xEnv, getRequestURI(), - OUString::createFromAscii( - "PROPFIND" ), + ucb::WebDAVHTTPMethod_PROPFIND, aHeaders ); m_xSession->PROPFIND( getRequestURI(), @@ -229,8 +228,7 @@ void DAVResourceAccess::PROPFIND( DAVRequestHeaders aHeaders; getUserRequestHeaders( xEnv, getRequestURI(), - OUString::createFromAscii( - "PROPFIND" ), + ucb::WebDAVHTTPMethod_PROPFIND, aHeaders ); m_xSession->PROPFIND( getRequestURI(), @@ -270,8 +268,7 @@ void DAVResourceAccess::PROPPATCH( DAVRequestHeaders aHeaders; getUserRequestHeaders( xEnv, getRequestURI(), - OUString::createFromAscii( - "PROPPATCH" ), + ucb::WebDAVHTTPMethod_PROPPATCH, aHeaders ); m_xSession->PROPPATCH( getRequestURI(), @@ -311,7 +308,7 @@ void DAVResourceAccess::HEAD( DAVRequestHeaders aHeaders; getUserRequestHeaders( xEnv, getRequestURI(), - OUString::createFromAscii( "HEAD" ), + ucb::WebDAVHTTPMethod_HEAD, aHeaders ); m_xSession->HEAD( getRequestURI(), @@ -351,7 +348,7 @@ uno::Reference< io::XInputStream > DAVResourceAccess::GET( DAVRequestHeaders aHeaders; getUserRequestHeaders( xEnv, getRequestURI(), - OUString::createFromAscii( "GET" ), + ucb::WebDAVHTTPMethod_GET, aHeaders ); xStream = m_xSession->GET( getRequestURI(), @@ -392,7 +389,7 @@ void DAVResourceAccess::GET( DAVRequestHeaders aHeaders; getUserRequestHeaders( xEnv, getRequestURI(), - OUString::createFromAscii( "GET" ), + ucb::WebDAVHTTPMethod_GET, aHeaders ); m_xSession->GET( getRequestURI(), @@ -433,7 +430,7 @@ uno::Reference< io::XInputStream > DAVResourceAccess::GET( DAVRequestHeaders aHeaders; getUserRequestHeaders( xEnv, getRequestURI(), - OUString::createFromAscii( "GET" ), + ucb::WebDAVHTTPMethod_GET, aHeaders ); xStream = m_xSession->GET( getRequestURI(), @@ -478,7 +475,7 @@ uno::Reference< io::XInputStream > DAVResourceAccess::GET( { getUserRequestHeaders( xEnv, getRequestURI(), - OUString( "GET" ), + ucb::WebDAVHTTPMethod_GET, rRequestHeaders ); xStream = m_xSession->GET( getRequestURI(), @@ -523,7 +520,7 @@ void DAVResourceAccess::GET( DAVRequestHeaders aHeaders; getUserRequestHeaders( xEnv, getRequestURI(), - OUString::createFromAscii( "GET" ), + ucb::WebDAVHTTPMethod_GET, aHeaders ); m_xSession->GET( getRequestURI(), @@ -610,7 +607,7 @@ void DAVResourceAccess::PUT( DAVRequestHeaders aHeaders; getUserRequestHeaders( xEnv, getRequestURI(), - OUString::createFromAscii( "PUT" ), + ucb::WebDAVHTTPMethod_PUT, aHeaders ); m_xSession->PUT( getRequestURI(), @@ -662,7 +659,7 @@ uno::Reference< io::XInputStream > DAVResourceAccess::POST( DAVRequestHeaders aHeaders; getUserRequestHeaders( xEnv, getRequestURI(), - OUString::createFromAscii( "POST" ), + ucb::WebDAVHTTPMethod_POST, aHeaders ); xStream = m_xSession->POST( getRequestURI(), @@ -725,7 +722,7 @@ void DAVResourceAccess::POST( DAVRequestHeaders aHeaders; getUserRequestHeaders( xEnv, getRequestURI(), - OUString::createFromAscii( "POST" ), + ucb::WebDAVHTTPMethod_POST, aHeaders ); m_xSession->POST( getRequestURI(), @@ -773,7 +770,7 @@ void DAVResourceAccess::MKCOL( DAVRequestHeaders aHeaders; getUserRequestHeaders( xEnv, getRequestURI(), - OUString::createFromAscii( "MKCOL" ), + ucb::WebDAVHTTPMethod_MKCOL, aHeaders ); m_xSession->MKCOL( getRequestURI(), @@ -813,7 +810,7 @@ void DAVResourceAccess::COPY( DAVRequestHeaders aHeaders; getUserRequestHeaders( xEnv, getRequestURI(), - OUString::createFromAscii( "COPY" ), + ucb::WebDAVHTTPMethod_COPY, aHeaders ); m_xSession->COPY( rSourcePath, @@ -855,7 +852,7 @@ void DAVResourceAccess::MOVE( DAVRequestHeaders aHeaders; getUserRequestHeaders( xEnv, getRequestURI(), - OUString::createFromAscii( "MOVE" ), + ucb::WebDAVHTTPMethod_MOVE, aHeaders ); m_xSession->MOVE( rSourcePath, @@ -894,8 +891,7 @@ void DAVResourceAccess::DESTROY( DAVRequestHeaders aHeaders; getUserRequestHeaders( xEnv, getRequestURI(), - OUString::createFromAscii( - "DESTROY" ), + ucb::WebDAVHTTPMethod_DELETE, aHeaders ); m_xSession->DESTROY( getRequestURI(), @@ -934,7 +930,7 @@ void DAVResourceAccess::LOCK( DAVRequestHeaders aHeaders; getUserRequestHeaders( xEnv, getRequestURI(), - OUString::createFromAscii( "LOCK" ), + ucb::WebDAVHTTPMethod_LOCK, aHeaders ); m_xSession->LOCK( getRequestURI(), @@ -976,7 +972,7 @@ sal_Int64 DAVResourceAccess::LOCK( DAVRequestHeaders aHeaders; getUserRequestHeaders( xEnv, getRequestURI(), - OUString::createFromAscii( "LOCK" ), + ucb::WebDAVHTTPMethod_LOCK, aHeaders ); nNewTimeout = m_xSession->LOCK( getRequestURI(), @@ -1018,7 +1014,7 @@ void DAVResourceAccess::UNLOCK( DAVRequestHeaders aHeaders; getUserRequestHeaders( xEnv, getRequestURI(), - OUString::createFromAscii( "UNLOCK" ), + ucb::WebDAVHTTPMethod_UNLOCK, aHeaders ); m_xSession->UNLOCK( getRequestURI(), @@ -1106,8 +1102,8 @@ const OUString & DAVResourceAccess::getRequestURI() const // static void DAVResourceAccess::getUserRequestHeaders( const uno::Reference< ucb::XCommandEnvironment > & xEnv, - const OUString & rURI, - const OUString & rMethod, + const rtl::OUString & rURI, + ucb::WebDAVHTTPMethod eMethod, DAVRequestHeaders & rRequestHeaders ) { if ( !xEnv.is() ) @@ -1120,7 +1116,7 @@ void DAVResourceAccess::getUserRequestHeaders( return; uno::Sequence< beans::StringPair > aRequestHeaders - = xDAVEnv->getUserRequestHeaders( rURI, rMethod ); + = xDAVEnv->getUserRequestHeaders( rURI, eMethod ); for ( sal_Int32 n = 0; n < aRequestHeaders.getLength(); ++n ) { diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.hxx b/ucb/source/ucp/webdav/DAVResourceAccess.hxx index 23705ce2772d..222b37eeb014 100644 --- a/ucb/source/ucp/webdav/DAVResourceAccess.hxx +++ b/ucb/source/ucp/webdav/DAVResourceAccess.hxx @@ -30,6 +30,7 @@ #include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/ucb/Lock.hpp> #include <com/sun/star/ucb/XCommandEnvironment.hpp> +#include <com/sun/star/ucb/WebDAVHTTPMethod.hpp> #include "DAVAuthListener.hxx" #include "DAVException.hxx" #include "DAVSession.hxx" @@ -226,8 +227,8 @@ public: getUserRequestHeaders( const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > & xEnv, - const OUString & rURI, - const OUString & rMethod, + const rtl::OUString & rURI, + com::sun::star::ucb::WebDAVHTTPMethod eMethod, DAVRequestHeaders & rRequestHeaders ); private: |