diff options
author | Kai Sommerfeld <kso@openoffice.org> | 2002-08-15 09:05:30 +0000 |
---|---|---|
committer | Kai Sommerfeld <kso@openoffice.org> | 2002-08-15 09:05:30 +0000 |
commit | f68200e5fc1b106f7125a79a84476fd4d5e1485d (patch) | |
tree | fa77fc02c9c84343083c7f28d34dbd4bf51b44dd /ucb/source/ucp/webdav/DAVResourceAccess.cxx | |
parent | 5ec3370446de39335e109f65c6ff451a0ab0a221 (diff) |
#96458# - Switched to new neon version (0.22.0)
- No longer needs tempfiles for PUT/POST
Diffstat (limited to 'ucb/source/ucp/webdav/DAVResourceAccess.cxx')
-rw-r--r-- | ucb/source/ucp/webdav/DAVResourceAccess.cxx | 79 |
1 files changed, 31 insertions, 48 deletions
diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx index f29564daa3c7..5875026274ac 100644 --- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx +++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx @@ -2,9 +2,9 @@ * * $RCSfile: DAVResourceAccess.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: kso $ $Date: 2001-11-26 09:45:37 $ + * last change: $Author: kso $ $Date: 2002-08-15 10:05:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -99,8 +99,8 @@ class AuthListener : public DAVAuthListener public: virtual int authenticate( const ::rtl::OUString & inRealm, const ::rtl::OUString & inHostName, - ::rtl::OUStringBuffer & inUserName, - ::rtl::OUStringBuffer & inPassWord, + ::rtl::OUString & inoutUserName, + ::rtl::OUString & outPassWord, const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& Environment ); @@ -123,8 +123,8 @@ using namespace com::sun::star; // virtual int AuthListener::authenticate( const ::rtl::OUString & inRealm, const ::rtl::OUString & inHostName, - ::rtl::OUStringBuffer & inUserName, - ::rtl::OUStringBuffer & inPassWord, + ::rtl::OUString & inoutUserName, + ::rtl::OUString & outPassWord, const uno::Reference< ucb::XCommandEnvironment >& Environment ) { @@ -135,11 +135,10 @@ int AuthListener::authenticate( const ::rtl::OUString & inRealm, if ( xIH.is() ) { rtl::Reference< ucbhelper::SimpleAuthenticationRequest > xRequest - = new ucbhelper::SimpleAuthenticationRequest( - inHostName, - inRealm, - rtl::OUString( inUserName ), - rtl::OUString( inPassWord ) ); + = new ucbhelper::SimpleAuthenticationRequest( inHostName, + inRealm, + inoutUserName, + outPassWord ); xIH->handle( xRequest.get() ); rtl::Reference< ucbhelper::InteractionContinuation > xSelection @@ -156,8 +155,8 @@ int AuthListener::authenticate( const ::rtl::OUString & inRealm, ucbhelper::InteractionSupplyAuthentication > & xSupp = xRequest->getAuthenticationSupplier(); - inUserName = xSupp->getUserName(); - inPassWord = xSupp->getPassword(); + inoutUserName = xSupp->getUserName(); + outPassWord = xSupp->getPassword(); // go on. return 0; @@ -188,23 +187,12 @@ DAVResourceAccess::DAVResourceAccess( const rtl::OUString & rURL ) throw( DAVException ) : m_aURL( rURL ), - m_bRedirected( sal_False ), m_xSMgr( rSMgr ), m_xSessionFactory( rSessionFactory ) { } //========================================================================= -void DAVResourceAccess::setURL( const rtl::OUString & rNewURL ) - throw( DAVException ) -{ - osl::Guard< osl::Mutex > aGuard( m_aMutex ); - m_bRedirected = sal_True; - m_aURL = rNewURL; - m_aPath = rtl::OUString(); // Next initialize() will create new session. -} - -//========================================================================= void DAVResourceAccess::OPTIONS( DAVCapabilities & rCapabilities, const uno::Reference< ucb::XCommandEnvironment > & xEnv ) @@ -582,12 +570,12 @@ void DAVResourceAccess::UNLOCK ( const ucb::Lock & rLock, } //========================================================================= -// DAVRedirectionListener method -// virtual -void DAVResourceAccess::redirectNotify( const rtl::OUString & rFromURI, - const rtl::OUString & rToURI ) +void DAVResourceAccess::setURL( const rtl::OUString & rNewURL ) + throw( DAVException ) { - setURL( rToURI ); + osl::Guard< osl::Mutex > aGuard( m_aMutex ); + m_aURL = rNewURL; + m_aPath = rtl::OUString(); // Next initialize() will create new session. } //========================================================================= @@ -605,18 +593,21 @@ void DAVResourceAccess::initialize() if ( !m_aPath.getLength() ) throw DAVException( DAVException::DAV_INVALID_ARG ); - // set the webdav session - try - { - m_xSession - = m_xSessionFactory->createDAVSession( m_aURL, m_xSMgr ); - m_xSession->setServerAuthListener( &webdavAuthListener ); - m_xSession->setRedirectionListener( this ); - } - catch ( DAVException const & ) + if ( !m_xSession.is() || !m_xSession->CanUse( m_aURL ) ) { - m_aPath = rtl::OUString(); - throw; + // create new webdav session + try + { + m_xSession + = m_xSessionFactory->createDAVSession( m_aURL, + m_xSMgr ); + m_xSession->setServerAuthListener( &webdavAuthListener ); + } + catch ( DAVException const & ) + { + m_aPath = rtl::OUString(); + throw; + } } } } @@ -640,14 +631,6 @@ sal_Bool DAVResourceAccess::handleException( DAVException & e ) } return sal_False; - case DAVException::DAV_HTTP_AUTH: - case DAVException::DAV_HTTP_AUTHPROXY: - case DAVException::DAV_HTTP_SERVERAUTH: - case DAVException::DAV_HTTP_PROXYAUTH: - // Retry. If user cancels the login request, - // we will get DAV_HTTP_ERROR and abort. - return sal_True; - default: return sal_False; // Abort } |