DAVResourceAccess.cxx (554deb42) | DAVResourceAccess.cxx (c5f58c9a) |
---|---|
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 --- 179 unchanged lines hidden (view full) --- 188 { 189 bRetry = false; 190 try 191 { 192 DAVRequestHeaders aHeaders; 193 194 getUserRequestHeaders( xEnv, 195 getRequestURI(), | 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 --- 179 unchanged lines hidden (view full) --- 188 { 189 bRetry = false; 190 try 191 { 192 DAVRequestHeaders aHeaders; 193 194 getUserRequestHeaders( xEnv, 195 getRequestURI(), |
196 rtl::OUString::createFromAscii( 197 "PROPFIND" ), | 196 ucb::WebDAVHTTPMethod_PROPFIND, |
198 aHeaders ); 199 200 m_xSession->PROPFIND( getRequestURI(), 201 nDepth, 202 rPropertyNames, 203 rResources, 204 DAVRequestEnvironment( 205 getRequestURI(), --- 25 unchanged lines hidden (view full) --- 231 do 232 { 233 bRetry = false; 234 try 235 { 236 DAVRequestHeaders aHeaders; 237 getUserRequestHeaders( xEnv, 238 getRequestURI(), | 197 aHeaders ); 198 199 m_xSession->PROPFIND( getRequestURI(), 200 nDepth, 201 rPropertyNames, 202 rResources, 203 DAVRequestEnvironment( 204 getRequestURI(), --- 25 unchanged lines hidden (view full) --- 230 do 231 { 232 bRetry = false; 233 try 234 { 235 DAVRequestHeaders aHeaders; 236 getUserRequestHeaders( xEnv, 237 getRequestURI(), |
239 rtl::OUString::createFromAscii( 240 "PROPFIND" ), | 238 ucb::WebDAVHTTPMethod_PROPFIND, |
241 aHeaders ); 242 243 m_xSession->PROPFIND( getRequestURI(), 244 nDepth, 245 rResInfo, 246 DAVRequestEnvironment( 247 getRequestURI(), 248 new DAVAuthListener_Impl( xEnv, m_aURL ), --- 23 unchanged lines hidden (view full) --- 272 do 273 { 274 bRetry = false; 275 try 276 { 277 DAVRequestHeaders aHeaders; 278 getUserRequestHeaders( xEnv, 279 getRequestURI(), | 239 aHeaders ); 240 241 m_xSession->PROPFIND( getRequestURI(), 242 nDepth, 243 rResInfo, 244 DAVRequestEnvironment( 245 getRequestURI(), 246 new DAVAuthListener_Impl( xEnv, m_aURL ), --- 23 unchanged lines hidden (view full) --- 270 do 271 { 272 bRetry = false; 273 try 274 { 275 DAVRequestHeaders aHeaders; 276 getUserRequestHeaders( xEnv, 277 getRequestURI(), |
280 rtl::OUString::createFromAscii( 281 "PROPPATCH" ), | 278 ucb::WebDAVHTTPMethod_PROPPATCH, |
282 aHeaders ); 283 284 m_xSession->PROPPATCH( getRequestURI(), 285 rValues, 286 DAVRequestEnvironment( 287 getRequestURI(), 288 new DAVAuthListener_Impl( xEnv, m_aURL ), 289 aHeaders, xEnv ) ); --- 23 unchanged lines hidden (view full) --- 313 do 314 { 315 bRetry = false; 316 try 317 { 318 DAVRequestHeaders aHeaders; 319 getUserRequestHeaders( xEnv, 320 getRequestURI(), | 279 aHeaders ); 280 281 m_xSession->PROPPATCH( getRequestURI(), 282 rValues, 283 DAVRequestEnvironment( 284 getRequestURI(), 285 new DAVAuthListener_Impl( xEnv, m_aURL ), 286 aHeaders, xEnv ) ); --- 23 unchanged lines hidden (view full) --- 310 do 311 { 312 bRetry = false; 313 try 314 { 315 DAVRequestHeaders aHeaders; 316 getUserRequestHeaders( xEnv, 317 getRequestURI(), |
321 rtl::OUString::createFromAscii( "HEAD" ), | 318 ucb::WebDAVHTTPMethod_HEAD, |
322 aHeaders ); 323 324 m_xSession->HEAD( getRequestURI(), 325 rHeaderNames, 326 rResource, 327 DAVRequestEnvironment( 328 getRequestURI(), 329 new DAVAuthListener_Impl( xEnv, m_aURL ), --- 23 unchanged lines hidden (view full) --- 353 do 354 { 355 bRetry = false; 356 try 357 { 358 DAVRequestHeaders aHeaders; 359 getUserRequestHeaders( xEnv, 360 getRequestURI(), | 319 aHeaders ); 320 321 m_xSession->HEAD( getRequestURI(), 322 rHeaderNames, 323 rResource, 324 DAVRequestEnvironment( 325 getRequestURI(), 326 new DAVAuthListener_Impl( xEnv, m_aURL ), --- 23 unchanged lines hidden (view full) --- 350 do 351 { 352 bRetry = false; 353 try 354 { 355 DAVRequestHeaders aHeaders; 356 getUserRequestHeaders( xEnv, 357 getRequestURI(), |
361 rtl::OUString::createFromAscii( "GET" ), | 358 ucb::WebDAVHTTPMethod_GET, |
362 aHeaders ); 363 364 xStream = m_xSession->GET( getRequestURI(), 365 DAVRequestEnvironment( 366 getRequestURI(), 367 new DAVAuthListener_Impl( 368 xEnv, m_aURL ), 369 aHeaders, xEnv ) ); --- 24 unchanged lines hidden (view full) --- 394 do 395 { 396 bRetry = false; 397 try 398 { 399 DAVRequestHeaders aHeaders; 400 getUserRequestHeaders( xEnv, 401 getRequestURI(), | 359 aHeaders ); 360 361 xStream = m_xSession->GET( getRequestURI(), 362 DAVRequestEnvironment( 363 getRequestURI(), 364 new DAVAuthListener_Impl( 365 xEnv, m_aURL ), 366 aHeaders, xEnv ) ); --- 24 unchanged lines hidden (view full) --- 391 do 392 { 393 bRetry = false; 394 try 395 { 396 DAVRequestHeaders aHeaders; 397 getUserRequestHeaders( xEnv, 398 getRequestURI(), |
402 rtl::OUString::createFromAscii( "GET" ), | 399 ucb::WebDAVHTTPMethod_GET, |
403 aHeaders ); 404 405 m_xSession->GET( getRequestURI(), 406 rStream, 407 DAVRequestEnvironment( 408 getRequestURI(), 409 new DAVAuthListener_Impl( xEnv, m_aURL ), 410 aHeaders, xEnv ) ); --- 24 unchanged lines hidden (view full) --- 435 do 436 { 437 bRetry = false; 438 try 439 { 440 DAVRequestHeaders aHeaders; 441 getUserRequestHeaders( xEnv, 442 getRequestURI(), | 400 aHeaders ); 401 402 m_xSession->GET( getRequestURI(), 403 rStream, 404 DAVRequestEnvironment( 405 getRequestURI(), 406 new DAVAuthListener_Impl( xEnv, m_aURL ), 407 aHeaders, xEnv ) ); --- 24 unchanged lines hidden (view full) --- 432 do 433 { 434 bRetry = false; 435 try 436 { 437 DAVRequestHeaders aHeaders; 438 getUserRequestHeaders( xEnv, 439 getRequestURI(), |
443 rtl::OUString::createFromAscii( "GET" ), | 440 ucb::WebDAVHTTPMethod_GET, |
444 aHeaders ); 445 446 xStream = m_xSession->GET( getRequestURI(), 447 rHeaderNames, 448 rResource, 449 DAVRequestEnvironment( 450 getRequestURI(), 451 new DAVAuthListener_Impl( --- 28 unchanged lines hidden (view full) --- 480 bool bRetry; 481 do 482 { 483 bRetry = false; 484 try 485 { 486 getUserRequestHeaders( xEnv, 487 getRequestURI(), | 441 aHeaders ); 442 443 xStream = m_xSession->GET( getRequestURI(), 444 rHeaderNames, 445 rResource, 446 DAVRequestEnvironment( 447 getRequestURI(), 448 new DAVAuthListener_Impl( --- 28 unchanged lines hidden (view full) --- 477 bool bRetry; 478 do 479 { 480 bRetry = false; 481 try 482 { 483 getUserRequestHeaders( xEnv, 484 getRequestURI(), |
488 rtl::OUString::createFromAscii( "GET" ), | 485 ucb::WebDAVHTTPMethod_GET, |
489 rRequestHeaders ); 490 491 xStream = m_xSession->GET( getRequestURI(), 492 rHeaderNames, 493 rResource, 494 DAVRequestEnvironment( 495 getRequestURI(), 496 new DAVAuthListener_Impl( --- 28 unchanged lines hidden (view full) --- 525 do 526 { 527 bRetry = false; 528 try 529 { 530 DAVRequestHeaders aHeaders; 531 getUserRequestHeaders( xEnv, 532 getRequestURI(), | 486 rRequestHeaders ); 487 488 xStream = m_xSession->GET( getRequestURI(), 489 rHeaderNames, 490 rResource, 491 DAVRequestEnvironment( 492 getRequestURI(), 493 new DAVAuthListener_Impl( --- 28 unchanged lines hidden (view full) --- 522 do 523 { 524 bRetry = false; 525 try 526 { 527 DAVRequestHeaders aHeaders; 528 getUserRequestHeaders( xEnv, 529 getRequestURI(), |
533 rtl::OUString::createFromAscii( "GET" ), | 530 ucb::WebDAVHTTPMethod_GET, |
534 aHeaders ); 535 536 m_xSession->GET( getRequestURI(), 537 rStream, 538 rHeaderNames, 539 rResource, 540 DAVRequestEnvironment( 541 getRequestURI(), --- 70 unchanged lines hidden (view full) --- 612 resetInputStream( xSeekableStream ); 613 614 bRetry = false; 615 try 616 { 617 DAVRequestHeaders aHeaders; 618 getUserRequestHeaders( xEnv, 619 getRequestURI(), | 531 aHeaders ); 532 533 m_xSession->GET( getRequestURI(), 534 rStream, 535 rHeaderNames, 536 rResource, 537 DAVRequestEnvironment( 538 getRequestURI(), --- 70 unchanged lines hidden (view full) --- 609 resetInputStream( xSeekableStream ); 610 611 bRetry = false; 612 try 613 { 614 DAVRequestHeaders aHeaders; 615 getUserRequestHeaders( xEnv, 616 getRequestURI(), |
620 rtl::OUString::createFromAscii( "PUT" ), | 617 ucb::WebDAVHTTPMethod_PUT, |
621 aHeaders ); 622 623 m_xSession->PUT( getRequestURI(), 624 xSeekableStream, 625 DAVRequestEnvironment( 626 getRequestURI(), 627 new DAVAuthListener_Impl( xEnv, m_aURL ), 628 aHeaders, xEnv ) ); --- 35 unchanged lines hidden (view full) --- 664 bRetry = false; 665 } 666 667 try 668 { 669 DAVRequestHeaders aHeaders; 670 getUserRequestHeaders( xEnv, 671 getRequestURI(), | 618 aHeaders ); 619 620 m_xSession->PUT( getRequestURI(), 621 xSeekableStream, 622 DAVRequestEnvironment( 623 getRequestURI(), 624 new DAVAuthListener_Impl( xEnv, m_aURL ), 625 aHeaders, xEnv ) ); --- 35 unchanged lines hidden (view full) --- 661 bRetry = false; 662 } 663 664 try 665 { 666 DAVRequestHeaders aHeaders; 667 getUserRequestHeaders( xEnv, 668 getRequestURI(), |
672 rtl::OUString::createFromAscii( "POST" ), | 669 ucb::WebDAVHTTPMethod_POST, |
673 aHeaders ); 674 675 xStream = m_xSession->POST( getRequestURI(), 676 rContentType, 677 rReferer, 678 xSeekableStream, 679 DAVRequestEnvironment( 680 getRequestURI(), --- 46 unchanged lines hidden (view full) --- 727 bRetry = false; 728 } 729 730 try 731 { 732 DAVRequestHeaders aHeaders; 733 getUserRequestHeaders( xEnv, 734 getRequestURI(), | 670 aHeaders ); 671 672 xStream = m_xSession->POST( getRequestURI(), 673 rContentType, 674 rReferer, 675 xSeekableStream, 676 DAVRequestEnvironment( 677 getRequestURI(), --- 46 unchanged lines hidden (view full) --- 724 bRetry = false; 725 } 726 727 try 728 { 729 DAVRequestHeaders aHeaders; 730 getUserRequestHeaders( xEnv, 731 getRequestURI(), |
735 rtl::OUString::createFromAscii( "POST" ), | 732 ucb::WebDAVHTTPMethod_POST, |
736 aHeaders ); 737 738 m_xSession->POST( getRequestURI(), 739 rContentType, 740 rReferer, 741 xSeekableStream, 742 rOutputStream, 743 DAVRequestEnvironment( --- 31 unchanged lines hidden (view full) --- 775 do 776 { 777 bRetry = false; 778 try 779 { 780 DAVRequestHeaders aHeaders; 781 getUserRequestHeaders( xEnv, 782 getRequestURI(), | 733 aHeaders ); 734 735 m_xSession->POST( getRequestURI(), 736 rContentType, 737 rReferer, 738 xSeekableStream, 739 rOutputStream, 740 DAVRequestEnvironment( --- 31 unchanged lines hidden (view full) --- 772 do 773 { 774 bRetry = false; 775 try 776 { 777 DAVRequestHeaders aHeaders; 778 getUserRequestHeaders( xEnv, 779 getRequestURI(), |
783 rtl::OUString::createFromAscii( "MKCOL" ), | 780 ucb::WebDAVHTTPMethod_MKCOL, |
784 aHeaders ); 785 786 m_xSession->MKCOL( getRequestURI(), 787 DAVRequestEnvironment( 788 getRequestURI(), 789 new DAVAuthListener_Impl( xEnv, m_aURL ), 790 aHeaders, xEnv ) ); 791 } --- 23 unchanged lines hidden (view full) --- 815 do 816 { 817 bRetry = false; 818 try 819 { 820 DAVRequestHeaders aHeaders; 821 getUserRequestHeaders( xEnv, 822 getRequestURI(), | 781 aHeaders ); 782 783 m_xSession->MKCOL( getRequestURI(), 784 DAVRequestEnvironment( 785 getRequestURI(), 786 new DAVAuthListener_Impl( xEnv, m_aURL ), 787 aHeaders, xEnv ) ); 788 } --- 23 unchanged lines hidden (view full) --- 812 do 813 { 814 bRetry = false; 815 try 816 { 817 DAVRequestHeaders aHeaders; 818 getUserRequestHeaders( xEnv, 819 getRequestURI(), |
823 rtl::OUString::createFromAscii( "COPY" ), | 820 ucb::WebDAVHTTPMethod_COPY, |
824 aHeaders ); 825 826 m_xSession->COPY( rSourcePath, 827 rDestinationURI, 828 DAVRequestEnvironment( 829 getRequestURI(), 830 new DAVAuthListener_Impl( xEnv, m_aURL ), 831 aHeaders, xEnv ), --- 25 unchanged lines hidden (view full) --- 857 do 858 { 859 bRetry = false; 860 try 861 { 862 DAVRequestHeaders aHeaders; 863 getUserRequestHeaders( xEnv, 864 getRequestURI(), | 821 aHeaders ); 822 823 m_xSession->COPY( rSourcePath, 824 rDestinationURI, 825 DAVRequestEnvironment( 826 getRequestURI(), 827 new DAVAuthListener_Impl( xEnv, m_aURL ), 828 aHeaders, xEnv ), --- 25 unchanged lines hidden (view full) --- 854 do 855 { 856 bRetry = false; 857 try 858 { 859 DAVRequestHeaders aHeaders; 860 getUserRequestHeaders( xEnv, 861 getRequestURI(), |
865 rtl::OUString::createFromAscii( "MOVE" ), | 862 ucb::WebDAVHTTPMethod_MOVE, |
866 aHeaders ); 867 868 m_xSession->MOVE( rSourcePath, 869 rDestinationURI, 870 DAVRequestEnvironment( 871 getRequestURI(), 872 new DAVAuthListener_Impl( xEnv, m_aURL ), 873 aHeaders, xEnv ), --- 22 unchanged lines hidden (view full) --- 896 do 897 { 898 bRetry = false; 899 try 900 { 901 DAVRequestHeaders aHeaders; 902 getUserRequestHeaders( xEnv, 903 getRequestURI(), | 863 aHeaders ); 864 865 m_xSession->MOVE( rSourcePath, 866 rDestinationURI, 867 DAVRequestEnvironment( 868 getRequestURI(), 869 new DAVAuthListener_Impl( xEnv, m_aURL ), 870 aHeaders, xEnv ), --- 22 unchanged lines hidden (view full) --- 893 do 894 { 895 bRetry = false; 896 try 897 { 898 DAVRequestHeaders aHeaders; 899 getUserRequestHeaders( xEnv, 900 getRequestURI(), |
904 rtl::OUString::createFromAscii( 905 "DESTROY" ), | 901 ucb::WebDAVHTTPMethod_DELETE, |
906 aHeaders ); 907 908 m_xSession->DESTROY( getRequestURI(), 909 DAVRequestEnvironment( 910 getRequestURI(), 911 new DAVAuthListener_Impl( xEnv, m_aURL ), 912 aHeaders, xEnv ) ); 913 } --- 22 unchanged lines hidden (view full) --- 936 do 937 { 938 bRetry = false; 939 try 940 { 941 DAVRequestHeaders aHeaders; 942 getUserRequestHeaders( xEnv, 943 getRequestURI(), | 902 aHeaders ); 903 904 m_xSession->DESTROY( getRequestURI(), 905 DAVRequestEnvironment( 906 getRequestURI(), 907 new DAVAuthListener_Impl( xEnv, m_aURL ), 908 aHeaders, xEnv ) ); 909 } --- 22 unchanged lines hidden (view full) --- 932 do 933 { 934 bRetry = false; 935 try 936 { 937 DAVRequestHeaders aHeaders; 938 getUserRequestHeaders( xEnv, 939 getRequestURI(), |
944 rtl::OUString::createFromAscii( "LOCK" ), | 940 ucb::WebDAVHTTPMethod_LOCK, |
945 aHeaders ); 946 947 m_xSession->LOCK( getRequestURI(), 948 inLock, 949 DAVRequestEnvironment( 950 getRequestURI(), 951 new DAVAuthListener_Impl( xEnv, m_aURL ), 952 aHeaders, xEnv ) ); --- 25 unchanged lines hidden (view full) --- 978 do 979 { 980 bRetry = false; 981 try 982 { 983 DAVRequestHeaders aHeaders; 984 getUserRequestHeaders( xEnv, 985 getRequestURI(), | 941 aHeaders ); 942 943 m_xSession->LOCK( getRequestURI(), 944 inLock, 945 DAVRequestEnvironment( 946 getRequestURI(), 947 new DAVAuthListener_Impl( xEnv, m_aURL ), 948 aHeaders, xEnv ) ); --- 25 unchanged lines hidden (view full) --- 974 do 975 { 976 bRetry = false; 977 try 978 { 979 DAVRequestHeaders aHeaders; 980 getUserRequestHeaders( xEnv, 981 getRequestURI(), |
986 rtl::OUString::createFromAscii( "LOCK" ), | 982 ucb::WebDAVHTTPMethod_LOCK, |
987 aHeaders ); 988 989 nNewTimeout = m_xSession->LOCK( getRequestURI(), 990 nTimeout, 991 DAVRequestEnvironment( 992 getRequestURI(), 993 new DAVAuthListener_Impl( 994 xEnv, m_aURL ), --- 25 unchanged lines hidden (view full) --- 1020 do 1021 { 1022 bRetry = false; 1023 try 1024 { 1025 DAVRequestHeaders aHeaders; 1026 getUserRequestHeaders( xEnv, 1027 getRequestURI(), | 983 aHeaders ); 984 985 nNewTimeout = m_xSession->LOCK( getRequestURI(), 986 nTimeout, 987 DAVRequestEnvironment( 988 getRequestURI(), 989 new DAVAuthListener_Impl( 990 xEnv, m_aURL ), --- 25 unchanged lines hidden (view full) --- 1016 do 1017 { 1018 bRetry = false; 1019 try 1020 { 1021 DAVRequestHeaders aHeaders; 1022 getUserRequestHeaders( xEnv, 1023 getRequestURI(), |
1028 rtl::OUString::createFromAscii( "UNLOCK" ), | 1024 ucb::WebDAVHTTPMethod_UNLOCK, |
1029 aHeaders ); 1030 1031 m_xSession->UNLOCK( getRequestURI(), 1032 DAVRequestEnvironment( 1033 getRequestURI(), 1034 new DAVAuthListener_Impl( xEnv, m_aURL ), 1035 aHeaders, xEnv ) ); 1036 } --- 72 unchanged lines hidden (view full) --- 1109 return m_aPath; 1110} 1111 1112//========================================================================= 1113// static 1114void DAVResourceAccess::getUserRequestHeaders( 1115 const uno::Reference< ucb::XCommandEnvironment > & xEnv, 1116 const rtl::OUString & rURI, | 1025 aHeaders ); 1026 1027 m_xSession->UNLOCK( getRequestURI(), 1028 DAVRequestEnvironment( 1029 getRequestURI(), 1030 new DAVAuthListener_Impl( xEnv, m_aURL ), 1031 aHeaders, xEnv ) ); 1032 } --- 72 unchanged lines hidden (view full) --- 1105 return m_aPath; 1106} 1107 1108//========================================================================= 1109// static 1110void DAVResourceAccess::getUserRequestHeaders( 1111 const uno::Reference< ucb::XCommandEnvironment > & xEnv, 1112 const rtl::OUString & rURI, |
1117 const rtl::OUString & rMethod, | 1113 ucb::WebDAVHTTPMethod eMethod, |
1118 DAVRequestHeaders & rRequestHeaders ) 1119{ 1120 if ( !xEnv.is() ) 1121 return; 1122 1123 uno::Reference< ucb::XWebDAVCommandEnvironment > xDAVEnv( 1124 xEnv, uno::UNO_QUERY ); 1125 1126 if ( !xDAVEnv.is() ) 1127 return; 1128 1129 uno::Sequence< beans::StringPair > aRequestHeaders | 1114 DAVRequestHeaders & rRequestHeaders ) 1115{ 1116 if ( !xEnv.is() ) 1117 return; 1118 1119 uno::Reference< ucb::XWebDAVCommandEnvironment > xDAVEnv( 1120 xEnv, uno::UNO_QUERY ); 1121 1122 if ( !xDAVEnv.is() ) 1123 return; 1124 1125 uno::Sequence< beans::StringPair > aRequestHeaders |
1130 = xDAVEnv->getUserRequestHeaders( rURI, rMethod ); | 1126 = xDAVEnv->getUserRequestHeaders( rURI, eMethod ); |
1131 1132 for ( sal_Int32 n = 0; n < aRequestHeaders.getLength(); ++n ) 1133 { 1134 rRequestHeaders.push_back( 1135 DAVRequestHeader( aRequestHeaders[ n ].First, 1136 aRequestHeaders[ n ].Second ) ); 1137 } 1138} --- 74 unchanged lines hidden --- | 1127 1128 for ( sal_Int32 n = 0; n < aRequestHeaders.getLength(); ++n ) 1129 { 1130 rRequestHeaders.push_back( 1131 DAVRequestHeader( aRequestHeaders[ n ].First, 1132 aRequestHeaders[ n ].Second ) ); 1133 } 1134} --- 74 unchanged lines hidden --- |