diff options
author | Matthias Kortstiege <mkortstiege@kodi.tv> | 2015-04-13 09:14:10 +0200 |
---|---|---|
committer | Matthias Kortstiege <mkortstiege@kodi.tv> | 2015-04-13 09:14:10 +0200 |
commit | 91ffcad4197a18888ac1f4998ccf0fc8dd026f0e (patch) | |
tree | e5250eb2e0ab8c0c56042c03dddca4b960c7670b | |
parent | cc252ce781bd00c06a5d422ce5192d73aafed4f1 (diff) |
[davfile] use PROPFIND for Stat() and Exists()
-rw-r--r-- | xbmc/filesystem/DAVFile.cpp | 15 | ||||
-rw-r--r-- | xbmc/filesystem/DAVFile.h | 6 |
2 files changed, 19 insertions, 2 deletions
diff --git a/xbmc/filesystem/DAVFile.cpp b/xbmc/filesystem/DAVFile.cpp index 9713c59e8e..d1964e79bf 100644 --- a/xbmc/filesystem/DAVFile.cpp +++ b/xbmc/filesystem/DAVFile.cpp @@ -130,6 +130,21 @@ bool CDAVFile::Delete(const CURL& url) return true; } +bool CDAVFile::Exists(const CURL& url) +{ + return Stat(url,NULL) == 0; +} + +int CDAVFile::Stat(const CURL& url, struct __stat64* buffer) +{ + CCurlFile dav; + std::string strRequest = "PROPFIND"; + dav.SetCustomRequest(strRequest); + dav.SetRequestHeader("depth", 0); + + return dav.Stat(url, buffer); +} + bool CDAVFile::Rename(const CURL& url, const CURL& urlnew) { if (m_opened) diff --git a/xbmc/filesystem/DAVFile.h b/xbmc/filesystem/DAVFile.h index 0190e8cdda..378ada8359 100644 --- a/xbmc/filesystem/DAVFile.h +++ b/xbmc/filesystem/DAVFile.h @@ -31,13 +31,15 @@ namespace XFILE virtual ~CDAVFile(void); virtual bool Execute(const CURL& url); - virtual bool Delete(const CURL& url); virtual bool Rename(const CURL& url, const CURL& urlnew); + virtual bool Exists(const CURL& url); + virtual int Stat(const CURL& url, struct __stat64* buffer); + virtual int GetLastResponseCode() { return lastResponseCode; } private: int lastResponseCode; }; -}
\ No newline at end of file +} |