diff options
-rw-r--r-- | extensions/source/update/feed/updatefeed.cxx | 2 | ||||
-rw-r--r-- | offapi/UnoApi_offapi.mk | 1 | ||||
-rw-r--r-- | offapi/com/sun/star/ucb/WebDAVHTTPMethod.idl | 114 | ||||
-rw-r--r-- | offapi/com/sun/star/ucb/XWebDAVCommandEnvironment.idl | 8 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/DAVResourceAccess.cxx | 48 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/DAVResourceAccess.hxx | 5 |
6 files changed, 146 insertions, 32 deletions
diff --git a/extensions/source/update/feed/updatefeed.cxx b/extensions/source/update/feed/updatefeed.cxx index b18b5c83654d..82e4427283a9 100644 --- a/extensions/source/update/feed/updatefeed.cxx +++ b/extensions/source/update/feed/updatefeed.cxx @@ -174,7 +174,7 @@ public: // XWebDAVCommandEnvironment virtual uno::Sequence< beans::StringPair > SAL_CALL getUserRequestHeaders( - const OUString&, const OUString& ) + const OUString&, ucb::WebDAVHTTPMethod ) throw ( uno::RuntimeException ) { return m_aRequestHeaderList; }; // XServiceInfo diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 26652d47c7da..8aff46bb2f39 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -1530,6 +1530,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/ucb,\ WebDAVContentProvider \ WebDAVDocumentContent \ WebDAVFolderContent \ + WebDAVHTTPMethod \ )) $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/ui,\ ActionTrigger \ diff --git a/offapi/com/sun/star/ucb/WebDAVHTTPMethod.idl b/offapi/com/sun/star/ucb/WebDAVHTTPMethod.idl new file mode 100644 index 000000000000..81fed33857ae --- /dev/null +++ b/offapi/com/sun/star/ucb/WebDAVHTTPMethod.idl @@ -0,0 +1,114 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_ucb_WebDAVHTTPMethod_idl__ +#define __com_sun_star_ucb_WebDAVHTTPMethod_idl__ + +module com { module sun { module star { module ucb { + + +/** Standard WebDAV/HTTP methods. + + @since Apache OpenOffice 4.0 +*/ +enum WebDAVHTTPMethod +{ + /** HTTP request method as defined in + <a target="_blank" href="http://tools.ietf.org/html/rfc2616#section-9.3">RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1</a> + */ + GET, + + /** HTTP request method as defined in + <a target="_blank" href="http://tools.ietf.org/html/rfc2616#section-9.4">RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1</a> + */ + HEAD, + + /** HTTP request method as defined in + <a target="_blank" href="http://tools.ietf.org/html/rfc2616#section-9.5">RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1</a> + */ + POST, + + /** HTTP request method as defined in + <a target="_blank" href="http://tools.ietf.org/html/rfc2616#section-9.6">RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1</a> + */ + PUT, + + /** HTTP request method as defined in + <a target="_blank" href="http://tools.ietf.org/html/rfc2616#section-9.7">RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1</a> + */ + DELETE, + + /** HTTP request method as defined in + <a target="_blank" href="http://tools.ietf.org/html/rfc2616#section-9.8">RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1</a> + */ + TRACE, + + /** HTTP request method as defined in + <a target="_blank" href="http://tools.ietf.org/html/rfc2616#section-9.2">RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1</a> + */ + OPTIONS, + + /** HTTP request method as defined in + <a target="_blank" href="http://tools.ietf.org/html/rfc2616#section-9.9">RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1</a> + */ + CONNECT, + + /** HTTP request method as defined in + <a target="_blank" href="http://tools.ietf.org/html/rfc5789">RFC 5789: PATCH Method for HTTP</a> + */ + PATCH, + + /** WebDAV methods as defined in + <a target="_blank" href="http://tools.ietf.org/html/rfc4918#section-9.1">HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)</a> + */ + PROPFIND, + + /** WebDAV methods as defined in + <a target="_blank" href="http://tools.ietf.org/html/rfc4918#section-9.2">HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)</a> + */ + PROPPATCH, + + /** WebDAV methods as defined in + <a target="_blank" href="http://tools.ietf.org/html/rfc4918#section-9.3">HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)</a> + */ + MKCOL, + + /** WebDAV methods as defined in + <a target="_blank" href="http://tools.ietf.org/html/rfc4918#section-9.8">HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)</a> + */ + COPY, + + /** WebDAV methods as defined in + <a target="_blank" href="http://tools.ietf.org/html/rfc4918#section-9.9">HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)</a> + */ + MOVE, + + /** WebDAV methods as defined in + <a target="_blank" href="http://tools.ietf.org/html/rfc4918#section-9.10">HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)</a> + */ + LOCK, + + /** WebDAV methods as defined in + <a target="_blank" href="http://tools.ietf.org/html/rfc4918#section-9.11">HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)</a> + */ + UNLOCK + +}; + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/ucb/XWebDAVCommandEnvironment.idl b/offapi/com/sun/star/ucb/XWebDAVCommandEnvironment.idl index 7bc17321ca30..bbf072ce3061 100644 --- a/offapi/com/sun/star/ucb/XWebDAVCommandEnvironment.idl +++ b/offapi/com/sun/star/ucb/XWebDAVCommandEnvironment.idl @@ -20,6 +20,7 @@ #define __com_sun_star_ucb_XWebDAVCommandEnvironment_idl__ #include <com/sun/star/ucb/XCommandEnvironment.idl> +#include <com/sun/star/ucb/WebDAVHTTPMethod.idl> #include <com/sun/star/beans/StringPair.idl> @@ -38,15 +39,16 @@ interface XWebDAVCommandEnvironment : XCommandEnvironment The request URI. @param aMethod - The WebDAV/HTTP method ("GET","PUT","MKCOL",...). + The WebDAV/HTTP method ("GET","PUT","MKCOL",...) as defined in + <type>WebDAVHTTPMethod</type>. @return A sequence of header name, header value pairs. The header names must be the plain names and contain no trailing ":". */ sequence<com::sun::star::beans::StringPair> getUserRequestHeaders( - [in] string aURI, - [in] string aMethod); + [in] string aURI, + [in] WebDAVHTTPMethod eMethod); }; }; }; }; }; 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: |