Kaydet (Commit) 7165b059 authored tarafından Ariel Constenla-Haile's avatar Ariel Constenla-Haile Kaydeden (comit) Stephan Bergmann

i121946 - Use enums to identify WebDAV/HTTP methods

(cherry picked from commit 122e10cf)
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 78cca630 "Revert
publishing of lots of UNO types.")

Change-Id: I153e394a194d0fcad29d3e3b27d5b24f7c259fc4
üst 3d737afd
......@@ -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
......
......@@ -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 \
......
/*
* 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
......@@ -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);
};
}; }; }; };
......
......@@ -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 )
{
......
......@@ -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:
......
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