1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef INCLUDED_UCB_SOURCE_UCP_WEBDAV_NEON_DAVRESOURCEACCESS_HXX
30 #define INCLUDED_UCB_SOURCE_UCP_WEBDAV_NEON_DAVRESOURCEACCESS_HXX
32 #include <config_lgpl.h>
34 #include <rtl/ustring.hxx>
35 #include <rtl/ref.hxx>
36 #include <osl/mutex.hxx>
37 #include <com/sun/star/io/XInputStream.hpp>
38 #include <com/sun/star/io/XOutputStream.hpp>
39 #include <com/sun/star/beans/NamedValue.hpp>
40 #include <com/sun/star/ucb/Lock.hpp>
41 #include <com/sun/star/ucb/WebDAVHTTPMethod.hpp>
42 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
43 #include "DAVAuthListener.hxx"
44 #include "DAVException.hxx"
45 #include "DAVSession.hxx"
46 #include "DAVResource.hxx"
47 #include "DAVTypes.hxx"
48 #include "NeonUri.hxx"
53 class DAVSessionFactory
;
55 class DAVResourceAccess
60 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::NamedValue
> m_aFlags
;
61 rtl::Reference
< DAVSession
> m_xSession
;
62 rtl::Reference
< DAVSessionFactory
> m_xSessionFactory
;
63 com::sun::star::uno::Reference
<
64 com::sun::star::uno::XComponentContext
> m_xContext
;
65 std::vector
< NeonUri
> m_aRedirectURIs
;
68 DAVResourceAccess() : m_xSessionFactory( 0 ) {}
69 DAVResourceAccess( const com::sun::star::uno::Reference
<
70 com::sun::star::uno::XComponentContext
> & rxContext
,
72 DAVSessionFactory
> const & rSessionFactory
,
73 const OUString
& rURL
);
74 DAVResourceAccess( const DAVResourceAccess
& rOther
);
76 DAVResourceAccess
& operator=( const DAVResourceAccess
& rOther
);
78 void setFlags( const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::NamedValue
>& rFlags
)
79 throw ( DAVException
);
81 void setURL( const OUString
& rNewURL
)
82 throw ( DAVException
);
86 const OUString
& getURL() const { return m_aURL
; }
88 rtl::Reference
< DAVSessionFactory
> getSessionFactory() const
89 { return m_xSessionFactory
; }
94 #if 0 // currently not used, but please don't remove code
96 OPTIONS( DAVCapabilities
& rCapabilities
,
97 const com::sun::star::uno::Reference
<
98 com::sun::star::ucb::XCommandEnvironment
> & xEnv
)
99 throw ( DAVException
);
104 PROPFIND( const Depth nDepth
,
105 const std::vector
< OUString
> & rPropertyNames
,
106 std::vector
< DAVResource
> & rResources
,
107 const com::sun::star::uno::Reference
<
108 com::sun::star::ucb::XCommandEnvironment
> & xEnv
)
109 throw ( DAVException
);
113 PROPFIND( const Depth nDepth
,
114 std::vector
< DAVResourceInfo
> & rResInfo
,
115 const com::sun::star::uno::Reference
<
116 com::sun::star::ucb::XCommandEnvironment
> & xEnv
)
117 throw ( DAVException
);
120 PROPPATCH( const std::vector
< ProppatchValue
> & rValues
,
121 const com::sun::star::uno::Reference
<
122 com::sun::star::ucb::XCommandEnvironment
>& xEnv
)
123 throw ( DAVException
);
126 HEAD( const std::vector
< OUString
> & rHeaderNames
, // empty == 'all'
127 DAVResource
& rResource
,
128 const com::sun::star::uno::Reference
<
129 com::sun::star::ucb::XCommandEnvironment
>& xEnv
)
130 throw ( DAVException
);
132 com::sun::star::uno::Reference
< com::sun::star::io::XInputStream
>
133 GET( const com::sun::star::uno::Reference
<
134 com::sun::star::ucb::XCommandEnvironment
> & xEnv
)
135 throw ( DAVException
);
138 GET( com::sun::star::uno::Reference
<
139 com::sun::star::io::XOutputStream
> & rStream
,
140 const com::sun::star::uno::Reference
<
141 com::sun::star::ucb::XCommandEnvironment
> & xEnv
)
142 throw ( DAVException
);
144 com::sun::star::uno::Reference
< com::sun::star::io::XInputStream
>
145 GET( const std::vector
< OUString
> & rHeaderNames
, // empty == 'all'
146 DAVResource
& rResource
,
147 const com::sun::star::uno::Reference
<
148 com::sun::star::ucb::XCommandEnvironment
> & xEnv
)
149 throw ( DAVException
);
152 GET( com::sun::star::uno::Reference
<
153 com::sun::star::io::XOutputStream
> & rStream
,
154 const std::vector
< OUString
> & rHeaderNames
, // empty == 'all'
155 DAVResource
& rResource
,
156 const com::sun::star::uno::Reference
<
157 com::sun::star::ucb::XCommandEnvironment
> & xEnv
)
158 throw ( DAVException
);
161 PUT( const com::sun::star::uno::Reference
<
162 com::sun::star::io::XInputStream
> & rStream
,
163 const com::sun::star::uno::Reference
<
164 com::sun::star::ucb::XCommandEnvironment
> & xEnv
)
165 throw (css::uno::RuntimeException
, DAVException
);
167 com::sun::star::uno::Reference
< com::sun::star::io::XInputStream
>
168 POST( const OUString
& rContentType
,
169 const OUString
& rReferer
,
170 const com::sun::star::uno::Reference
<
171 com::sun::star::io::XInputStream
> & rInputStream
,
172 const com::sun::star::uno::Reference
<
173 com::sun::star::ucb::XCommandEnvironment
>& xEnv
)
174 throw (css::uno::RuntimeException
, DAVException
);
177 POST( const OUString
& rContentType
,
178 const OUString
& rReferer
,
179 const com::sun::star::uno::Reference
<
180 com::sun::star::io::XInputStream
> & rInputStream
,
181 com::sun::star::uno::Reference
<
182 com::sun::star::io::XOutputStream
> & rOutputStream
,
183 const com::sun::star::uno::Reference
<
184 com::sun::star::ucb::XCommandEnvironment
>& xEnv
)
185 throw (css::uno::RuntimeException
, DAVException
);
188 MKCOL( const com::sun::star::uno::Reference
<
189 com::sun::star::ucb::XCommandEnvironment
> & xEnv
)
190 throw ( DAVException
);
193 COPY( const OUString
& rSourcePath
,
194 const OUString
& rDestinationURI
,
196 const com::sun::star::uno::Reference
<
197 com::sun::star::ucb::XCommandEnvironment
> & xEnv
)
198 throw ( DAVException
);
201 MOVE( const OUString
& rSourcePath
,
202 const OUString
& rDestinationURI
,
204 const com::sun::star::uno::Reference
<
205 com::sun::star::ucb::XCommandEnvironment
> & xEnv
)
206 throw ( DAVException
);
209 DESTROY( const com::sun::star::uno::Reference
<
210 com::sun::star::ucb::XCommandEnvironment
> & xEnv
)
211 throw ( DAVException
);
215 LOCK( com::sun::star::ucb::Lock
& inLock
,
216 const com::sun::star::uno::Reference
<
217 com::sun::star::ucb::XCommandEnvironment
> & xEnv
)
218 throw( DAVException
);
220 #if 0 // currently not used, but please don't remove code
221 // refresh existing lock.
223 LOCK( sal_Int64 nTimeout
,
224 const com::sun::star::uno::Reference
<
225 com::sun::star::ucb::XCommandEnvironment
> & xEnv
)
226 throw ( DAVException
);
230 UNLOCK( const com::sun::star::uno::Reference
<
231 com::sun::star::ucb::XCommandEnvironment
> & xEnv
)
232 throw ( DAVException
);
236 throw ( DAVException
);
240 getUserRequestHeaders(
241 const com::sun::star::uno::Reference
<
242 com::sun::star::ucb::XCommandEnvironment
> & xEnv
,
243 const OUString
& rURI
,
244 com::sun::star::ucb::WebDAVHTTPMethod eMethod
,
245 DAVRequestHeaders
& rRequestHeaders
);
248 const OUString
& getRequestURI() const;
249 bool detectRedirectCycle( const OUString
& rRedirectURL
)
250 throw ( DAVException
);
251 bool handleException( const DAVException
& e
, int errorCount
)
252 throw ( DAVException
);
254 throw ( DAVException
);
257 } // namespace webdav_ucp
259 #endif // INCLUDED_UCB_SOURCE_UCP_WEBDAV_NEON_DAVRESOURCEACCESS_HXX
261 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */