1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 // MARKER(update_precomp.py): autogen include statement, do not remove
23 #include "precompiled_ucb.hxx"
24 
25 #include "SerfTypes.hxx"
26 #include "SerfRequestProcessorImplFac.hxx"
27 #include "SerfPropFindReqProcImpl.hxx"
28 #include "SerfPropPatchReqProcImpl.hxx"
29 #include "SerfGetReqProcImpl.hxx"
30 #include "SerfHeadReqProcImpl.hxx"
31 #include "SerfPutReqProcImpl.hxx"
32 #include "SerfPostReqProcImpl.hxx"
33 #include "SerfDeleteReqProcImpl.hxx"
34 #include "SerfMkColReqProcImpl.hxx"
35 #include "SerfCopyReqProcImpl.hxx"
36 #include "SerfMoveReqProcImpl.hxx"
37 #include "SerfLockReqProcImpl.hxx"
38 #include "SerfLockRefreshProcImpl.hxx"
39 #include "SerfUnlockProcImpl.hxx"
40 
41 namespace http_dav_ucp
42 {
createPropFindReqProcImpl(const char * inPath,const DAVRequestHeaders & inRequestHeaders,const Depth inDepth,const std::vector<::rtl::OUString> & inPropNames,std::vector<DAVResource> & ioResources)43     SerfRequestProcessorImpl* createPropFindReqProcImpl( const char* inPath,
44                                                          const DAVRequestHeaders& inRequestHeaders,
45                                                          const Depth inDepth,
46                                                          const std::vector< ::rtl::OUString > & inPropNames,
47                                                          std::vector< DAVResource > & ioResources )
48     {
49         SerfRequestProcessorImpl* pReqProcImpl = new SerfPropFindReqProcImpl( inPath,
50                                                                               inRequestHeaders,
51                                                                               inDepth,
52                                                                               inPropNames,
53                                                                               ioResources );
54         return pReqProcImpl;
55     }
56 
createPropFindReqProcImpl(const char * inPath,const DAVRequestHeaders & inRequestHeaders,const Depth inDepth,std::vector<DAVResourceInfo> & ioResInfo)57     SerfRequestProcessorImpl* createPropFindReqProcImpl( const char* inPath,
58                                                          const DAVRequestHeaders& inRequestHeaders,
59                                                          const Depth inDepth,
60                                                          std::vector< DAVResourceInfo > & ioResInfo )
61     {
62         SerfRequestProcessorImpl* pReqProcImpl = new SerfPropFindReqProcImpl( inPath,
63                                                                               inRequestHeaders,
64                                                                               inDepth,
65                                                                               ioResInfo );
66         return pReqProcImpl;
67     }
68 
createPropPatchReqProcImpl(const char * inPath,const DAVRequestHeaders & inRequestHeaders,const std::vector<ProppatchValue> & inProperties,const char * inLockToken)69     SerfRequestProcessorImpl* createPropPatchReqProcImpl( const char* inPath,
70                                                           const DAVRequestHeaders& inRequestHeaders,
71                                                           const std::vector< ProppatchValue > & inProperties,
72                                                           const char* inLockToken )
73     {
74         SerfRequestProcessorImpl* pReqProcImpl = new SerfPropPatchReqProcImpl( inPath,
75                                                                                inRequestHeaders,
76                                                                                inProperties,
77                                                                                inLockToken );
78         return pReqProcImpl;
79     }
80 
createGetReqProcImpl(const char * inPath,const DAVRequestHeaders & inRequestHeaders,const com::sun::star::uno::Reference<SerfInputStream> & xioInStrm)81     SerfRequestProcessorImpl* createGetReqProcImpl( const char* inPath,
82                                                     const DAVRequestHeaders& inRequestHeaders,
83                                                     const com::sun::star::uno::Reference< SerfInputStream >& xioInStrm )
84     {
85         SerfRequestProcessorImpl* pReqProcImpl = new SerfGetReqProcImpl( inPath,
86                                                                          inRequestHeaders,
87                                                                          xioInStrm );
88         return pReqProcImpl;
89     }
90 
createGetReqProcImpl(const char * inPath,const DAVRequestHeaders & inRequestHeaders,const com::sun::star::uno::Reference<SerfInputStream> & xioInStrm,const std::vector<::rtl::OUString> & inHeaderNames,DAVResource & ioResource)91     SerfRequestProcessorImpl* createGetReqProcImpl( const char* inPath,
92                                                     const DAVRequestHeaders& inRequestHeaders,
93                                                     const com::sun::star::uno::Reference< SerfInputStream >& xioInStrm,
94                                                     const std::vector< ::rtl::OUString > & inHeaderNames,
95                                                     DAVResource& ioResource )
96     {
97         SerfRequestProcessorImpl* pReqProcImpl = new SerfGetReqProcImpl( inPath,
98                                                                          inRequestHeaders,
99                                                                          xioInStrm,
100                                                                          inHeaderNames,
101                                                                          ioResource );
102         return pReqProcImpl;
103     }
104 
createGetReqProcImpl(const char * inPath,const DAVRequestHeaders & inRequestHeaders,const com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> & xioOutStrm)105     SerfRequestProcessorImpl* createGetReqProcImpl( const char* inPath,
106                                                     const DAVRequestHeaders& inRequestHeaders,
107                                                     const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xioOutStrm )
108     {
109         SerfRequestProcessorImpl* pReqProcImpl = new SerfGetReqProcImpl( inPath,
110                                                                          inRequestHeaders,
111                                                                          xioOutStrm );
112         return pReqProcImpl;
113     }
114 
createGetReqProcImpl(const char * inPath,const DAVRequestHeaders & inRequestHeaders,const com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> & xioOutStrm,const std::vector<::rtl::OUString> & inHeaderNames,DAVResource & ioResource)115     SerfRequestProcessorImpl* createGetReqProcImpl( const char* inPath,
116                                                     const DAVRequestHeaders& inRequestHeaders,
117                                                     const com::sun::star::uno::Reference<com::sun::star::io::XOutputStream >& xioOutStrm,
118                                                     const std::vector< ::rtl::OUString > & inHeaderNames,
119                                                     DAVResource& ioResource )
120     {
121         SerfRequestProcessorImpl* pReqProcImpl = new SerfGetReqProcImpl( inPath,
122                                                                          inRequestHeaders,
123                                                                          xioOutStrm,
124                                                                          inHeaderNames,
125                                                                          ioResource );
126         return pReqProcImpl;
127     }
128 
createHeadReqProcImpl(const char * inPath,const DAVRequestHeaders & inRequestHeaders,const std::vector<::rtl::OUString> & inHeaderNames,DAVResource & ioResource)129     SerfRequestProcessorImpl* createHeadReqProcImpl( const char* inPath,
130                                                      const DAVRequestHeaders& inRequestHeaders,
131                                                      const std::vector< ::rtl::OUString > & inHeaderNames,
132                                                      DAVResource& ioResource )
133     {
134         SerfRequestProcessorImpl* pReqProcImpl = new SerfHeadReqProcImpl( inPath,
135                                                                           inRequestHeaders,
136                                                                           inHeaderNames,
137                                                                           ioResource );
138         return pReqProcImpl;
139     }
140 
141 
createPutReqProcImpl(const char * inPath,const DAVRequestHeaders & inRequestHeaders,const char * inData,const char * inLockToken,apr_size_t inDataLen)142     SerfRequestProcessorImpl* createPutReqProcImpl( const char* inPath,
143                                                     const DAVRequestHeaders& inRequestHeaders,
144                                                     const char* inData,
145                                                     const char* inLockToken,
146                                                     apr_size_t inDataLen )
147     {
148         SerfRequestProcessorImpl* pReqProcImpl = new SerfPutReqProcImpl( inPath,
149                                                                          inRequestHeaders,
150                                                                          inData,
151                                                                          inLockToken,
152                                                                          inDataLen );
153         return pReqProcImpl;
154     }
155 
createPostReqProcImpl(const char * inPath,const DAVRequestHeaders & inRequestHeaders,const char * inData,apr_size_t inDataLen,const char * inLockToken,const char * inContentType,const char * inReferer,const com::sun::star::uno::Reference<SerfInputStream> & xioInStrm)156     SerfRequestProcessorImpl* createPostReqProcImpl( const char* inPath,
157                                                      const DAVRequestHeaders& inRequestHeaders,
158                                                      const char* inData,
159                                                      apr_size_t inDataLen,
160                                                      const char* inLockToken,
161                                                      const char* inContentType,
162                                                      const char* inReferer,
163                                                      const com::sun::star::uno::Reference< SerfInputStream >& xioInStrm )
164     {
165         SerfRequestProcessorImpl* pReqProcImpl = new SerfPostReqProcImpl( inPath,
166                                                                           inRequestHeaders,
167                                                                           inData,
168                                                                           inDataLen,
169                                                                           inLockToken,
170                                                                           inContentType,
171                                                                           inReferer,
172                                                                           xioInStrm );
173         return pReqProcImpl;
174     }
175 
createPostReqProcImpl(const char * inPath,const DAVRequestHeaders & inRequestHeaders,const char * inData,apr_size_t inDataLen,const char * inLockToken,const char * inContentType,const char * inReferer,const com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> & xioOutStrm)176     SerfRequestProcessorImpl* createPostReqProcImpl( const char* inPath,
177                                                      const DAVRequestHeaders& inRequestHeaders,
178                                                      const char* inData,
179                                                      apr_size_t inDataLen,
180                                                      const char* inLockToken,
181                                                      const char* inContentType,
182                                                      const char* inReferer,
183                                                      const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xioOutStrm )
184     {
185         SerfRequestProcessorImpl* pReqProcImpl = new SerfPostReqProcImpl( inPath,
186                                                                           inRequestHeaders,
187                                                                           inData,
188                                                                           inDataLen,
189                                                                           inLockToken,
190                                                                           inContentType,
191                                                                           inReferer,
192                                                                           xioOutStrm );
193         return pReqProcImpl;
194     }
195 
createDeleteReqProcImpl(const char * inPath,const DAVRequestHeaders & inRequestHeaders,const char * inLockToken)196     SerfRequestProcessorImpl* createDeleteReqProcImpl( const char* inPath,
197                                                        const DAVRequestHeaders& inRequestHeaders,
198                                                        const char * inLockToken )
199     {
200         SerfRequestProcessorImpl* pReqProcImpl = new SerfDeleteReqProcImpl( inPath,
201                                                                             inRequestHeaders,
202                                                                             inLockToken );
203         return pReqProcImpl;
204     }
205 
createMkColReqProcImpl(const char * inPath,const DAVRequestHeaders & inRequestHeaders,const char * inLockToken)206     SerfRequestProcessorImpl* createMkColReqProcImpl( const char* inPath,
207                                                       const DAVRequestHeaders& inRequestHeaders,
208                                                       const char * inLockToken )
209     {
210         SerfRequestProcessorImpl* pReqProcImpl = new SerfMkColReqProcImpl( inPath,
211                                                                            inRequestHeaders,
212                                                                            inLockToken );
213         return pReqProcImpl;
214     }
215 
createCopyReqProcImpl(const char * inSourcePath,const DAVRequestHeaders & inRequestHeaders,const char * inDestinationPath,const bool inOverwrite,const char * inLockToken)216     SerfRequestProcessorImpl* createCopyReqProcImpl( const char* inSourcePath,
217                                                      const DAVRequestHeaders& inRequestHeaders,
218                                                      const char* inDestinationPath,
219                                                      const bool inOverwrite,
220                                                      const char* inLockToken )
221     {
222         SerfRequestProcessorImpl* pReqProcImpl = new SerfCopyReqProcImpl( inSourcePath,
223                                                                           inRequestHeaders,
224                                                                           inDestinationPath,
225                                                                           inOverwrite,
226                                                                           inLockToken );
227         return pReqProcImpl;
228     }
229 
createMoveReqProcImpl(const char * inSourcePath,const DAVRequestHeaders & inRequestHeaders,const char * inDestinationPath,const bool inOverwrite,const char * inLockToken)230     SerfRequestProcessorImpl* createMoveReqProcImpl( const char* inSourcePath,
231                                                      const DAVRequestHeaders& inRequestHeaders,
232                                                      const char* inDestinationPath,
233                                                      const bool inOverwrite,
234                                                      const char* inLockToken )
235     {
236         SerfRequestProcessorImpl* pReqProcImpl = new SerfMoveReqProcImpl( inSourcePath,
237                                                                           inRequestHeaders,
238                                                                           inDestinationPath,
239                                                                           inOverwrite,
240                                                                           inLockToken );
241         return pReqProcImpl;
242     }
243 
createLockReqProcImpl(const char * inSourcePath,const DAVRequestHeaders & inRequestHeaders,const ucb::Lock & inLock,const char * inTimeout,DAVPropertyValue & outLock)244     SerfRequestProcessorImpl* createLockReqProcImpl( const char* inSourcePath,
245                                                      const DAVRequestHeaders& inRequestHeaders,
246                                                      const ucb::Lock& inLock,
247                                                      const char* inTimeout,
248                                                      DAVPropertyValue & outLock)
249     {
250         SerfRequestProcessorImpl* pReqProcImpl = new SerfLockReqProcImpl( inSourcePath,
251                                                                           inRequestHeaders,
252                                                                           inLock,
253                                                                           inTimeout,
254                                                                           outLock);
255         return pReqProcImpl;
256     }
257 
createLockRefreshProcImpl(const char * inSourcePath,const DAVRequestHeaders & inRequestHeaders,const ucb::Lock & inLock,const char * inLockToken,const char * inTimeout,DAVPropertyValue & outLock)258     SerfRequestProcessorImpl* createLockRefreshProcImpl( const char* inSourcePath,
259                                                          const DAVRequestHeaders& inRequestHeaders,
260                                                          const ucb::Lock& inLock,
261                                                          const char* inLockToken,
262                                                          const char* inTimeout,
263                                                          DAVPropertyValue & outLock)
264     {
265         SerfRequestProcessorImpl* pReqProcImpl = new SerfLockRefreshProcImpl( inSourcePath,
266                                                                               inRequestHeaders,
267                                                                               inLock,
268                                                                               inLockToken,
269                                                                               inTimeout,
270                                                                               outLock);
271         return pReqProcImpl;
272     }
273 
createUnlockProcImpl(const char * inSourcePath,const DAVRequestHeaders & inRequestHeaders,const ucb::Lock & inLock,const char * inToken)274     SerfRequestProcessorImpl* createUnlockProcImpl( const char* inSourcePath,
275                                                          const DAVRequestHeaders& inRequestHeaders,
276                                                          const ucb::Lock& inLock,
277                                                          const char* inToken )
278     {
279         SerfRequestProcessorImpl* pReqProcImpl = new SerfUnlockProcImpl( inSourcePath,
280                                                                          inRequestHeaders,
281                                                                          inLock,
282                                                                          inToken );
283         return pReqProcImpl;
284     }
285 
286 } // namespace http_dav_ucp
287