From 292560a957498bed70b625c992ec6bcf631dceb3 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 17 Oct 2016 13:23:23 +0200 Subject: loplugin:unusedmethods Change-Id: Icf773925c37dde8b7404edac9864e7b10fe113b4 Reviewed-on: https://gerrit.libreoffice.org/29968 Tested-by: Jenkins Reviewed-by: Noel Grandin --- ucb/source/ucp/webdav-neon/DAVTypes.cxx | 53 --------------------------------- ucb/source/ucp/webdav-neon/DAVTypes.hxx | 16 ---------- 2 files changed, 69 deletions(-) (limited to 'ucb') diff --git a/ucb/source/ucp/webdav-neon/DAVTypes.cxx b/ucb/source/ucp/webdav-neon/DAVTypes.cxx index 5c1844d0f12d..02ae439eb758 100644 --- a/ucb/source/ucp/webdav-neon/DAVTypes.cxx +++ b/ucb/source/ucp/webdav-neon/DAVTypes.cxx @@ -171,31 +171,6 @@ void DAVOptionsCache::addDAVOptions( DAVOptions & rDAVOptions, const sal_uInt32 m_aTheCache[ aEncodedUrl ] = rDAVOptions; } -sal_uInt16 DAVOptionsCache::getHttpResponseStatusCode( const OUString & rURL, OUString & rHttpResponseStatusText ) -{ - osl::MutexGuard aGuard( m_aMutex ); - OUString aEncodedUrl( ucb_impl::urihelper::encodeURI( NeonUri::unescape( rURL ) ) ); - normalizeURLLastChar( aEncodedUrl ); - - DAVOptionsMap::iterator it; - it = m_aTheCache.find( aEncodedUrl ); - if ( it != m_aTheCache.end() ) - { - // first check for stale - TimeValue t1; - osl_getSystemTime( &t1 ); - if( (*it).second.getStaleTime() < t1.Seconds ) - { - m_aTheCache.erase( it ); - return 0; - } - - rHttpResponseStatusText = (*it).second.getHttpResponseStatusText(); - return (*it).second.getHttpResponseStatusCode(); - } - return 0; -} - void DAVOptionsCache::setHeadAllowed( const OUString & rURL, const bool HeadAllowed ) { osl::MutexGuard aGuard( m_aMutex ); @@ -219,32 +194,4 @@ void DAVOptionsCache::setHeadAllowed( const OUString & rURL, const bool HeadAllo } } -bool DAVOptionsCache::isHeadAllowed( const OUString & rURL ) -{ - osl::MutexGuard aGuard( m_aMutex ); - OUString aEncodedUrl( ucb_impl::urihelper::encodeURI( NeonUri::unescape( rURL ) ) ); - normalizeURLLastChar( aEncodedUrl ); - - DAVOptionsMap::iterator it; - it = m_aTheCache.find( aEncodedUrl ); - if ( it != m_aTheCache.end() ) - { - // first check for stale - TimeValue t1; - osl_getSystemTime( &t1 ); - if( (*it).second.getStaleTime() < t1.Seconds ) - { - m_aTheCache.erase( it ); - return true; // to force again OPTIONS method - } - - // check if the resource was present on server - return (*it).second.isHeadAllowed(); - } - // this value is needed because some web server don't implement - // OPTIONS method, so the resource is considered found, - // until detected otherwise - return true; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/ucb/source/ucp/webdav-neon/DAVTypes.hxx b/ucb/source/ucp/webdav-neon/DAVTypes.hxx index c7c37156bd4f..8474ad943f3a 100644 --- a/ucb/source/ucp/webdav-neon/DAVTypes.hxx +++ b/ucb/source/ucp/webdav-neon/DAVTypes.hxx @@ -180,22 +180,6 @@ namespace webdav_ucp void removeDAVOptions( const OUString & rURL ); void addDAVOptions( DAVOptions & rDAVOptions, const sal_uInt32 nLifeTime ); - /** return the cached value of HTTP response status code - If the cached value is found stale, it is removed. - - @param (in) OUString - the resource URL - - @return int - the cached - are not present (meaning the resource should be checked for - presence anyway) - false if resource was not found - */ - sal_uInt16 getHttpResponseStatusCode( const OUString & rURL, OUString & rHttpResponseStatusText ); - - bool isHeadAllowed( const OUString & rURL ); - void setHeadAllowed( const OUString & rURL, bool HeadAllowed = true ); private: -- cgit