14#include "../inc/urihelper.hxx"
24DAVOptions::DAVOptions() :
28 m_isHeadAllowed( true ),
32 m_nRequestedTimeLife( 0 ),
35 m_nHttpResponseStatusCode( 0 ),
36 m_sHttpResponseStatusText()
41 m_isClass1( rOther.m_isClass1 ),
42 m_isClass2( rOther.m_isClass2 ),
43 m_isClass3( rOther.m_isClass3 ),
44 m_isHeadAllowed( rOther.m_isHeadAllowed ),
45 m_isLocked( rOther.m_isLocked ),
46 m_aAllowedMethods( rOther.m_aAllowedMethods ),
47 m_nStaleTime( rOther.m_nStaleTime ),
48 m_nRequestedTimeLife( rOther.m_nRequestedTimeLife ),
50 m_sRedirectedURL( rOther.m_sRedirectedURL),
51 m_nHttpResponseStatusCode( rOther.m_nHttpResponseStatusCode ),
52 m_sHttpResponseStatusText( rOther.m_sHttpResponseStatusText )
107 std::unique_lock aGuard(
m_aMutex );
112 DAVOptionsMap::iterator it;
120 osl_getSystemTime( &t1 );
121 if ( (*it).second.getStaleTime() < t1.Seconds )
128 rDAVOptions = (*it).second;
135 std::unique_lock aGuard(
m_aMutex );
139 DAVOptionsMap::iterator it;
149 std::unique_lock aGuard(
m_aMutex );
154 rDAVOptions.
setURL( aEncodedUrl );
161 DAVOptionsMap::iterator it;
165 if ( (*it).second.getRequestedTimeLife() == nLifeTime )
171 if ((*it).second.isClass1())
173 rDAVOptions.
setClass1( (*it).second.isClass1() );
178 osl_getSystemTime( &t1 );
186 std::unique_lock aGuard(
m_aMutex );
190 DAVOptionsMap::iterator it;
196 osl_getSystemTime( &t1 );
197 if( (*it).second.getStaleTime() < t1.Seconds )
203 (*it).second.setHeadAllowed( HeadAllowed );
DAVOptionsMap m_aTheCache
bool getDAVOptions(const OUString &rURL, DAVOptions &rDAVOptions)
void setHeadAllowed(const OUString &rURL, bool HeadAllowed=true)
static void normalizeURLLastChar(OUString &aUrl)
remove the last '/' in aUrl, if it exists
void removeDAVOptions(const OUString &rURL)
void addDAVOptions(DAVOptions &rDAVOptions, const sal_uInt32 nLifeTime)
bool operator==(const DAVOptions &rOpts) const
bool m_isHeadAllowed
for server that do not implement it
const OUString & getURL() const
sal_uInt16 m_nHttpResponseStatusCode
The cached HTT response status code. It's 0 if the code was dealt with and there is no need to cache ...
sal_uInt32 m_nRequestedTimeLife
DAVOptions & operator=(const DAVOptions &rOpts)
sal_uInt32 m_nStaleTime
target time when this capability becomes stale
OUString m_sHttpResponseStatusText
The cached string with the server returned HTTP response status code string, corresponds to m_nHttpRe...
void setStaleTime(const sal_uInt32 nStaleTime)
const OUString & getRedirectedURL() const
OUString m_aAllowedMethods
contains the methods allowed on this resource
void setURL(const OUString &sURL)
void setClass1(bool Class1=true)
void setRedirectedURL(const OUString &sRedirectedURL)
OUString m_sRedirectedURL
bool m_isLocked
Internally used to maintain the locked state of the resource, only if it's a Class 2 resource.
OUString DecodeURI(OUString const &rURI)
OUString encodeURI(const OUString &rURI)