aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xbmc/filesystem/DAVFile.cpp15
-rw-r--r--xbmc/filesystem/DAVFile.h6
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
+}