File indexing completed on 2024-05-12 04:46:02

0001 #ifndef DTO_WEBDAVITEM_HPP
0002 #define DTO_WEBDAVITEM_HPP
0003 
0004 #include <QDateTime>
0005 #include <QIODevice>
0006 #include <QString>
0007 
0008 class WebDAV;
0009 class WebDAVReply;
0010 
0011 class WebDAVItem {
0012  public:
0013   WebDAVItem(WebDAV* webdavClient, QString href, QString creationDate,
0014              QString lastModified, QString displayName, QString contentType,
0015              QString contentLength, bool isCollection);
0016 
0017   bool isCollection();
0018   bool isFile();
0019 
0020   WebDAVReply* download();
0021   WebDAVReply* listDir();
0022   WebDAVReply* upload(QString filename, QIODevice* file);
0023   WebDAVReply* createDir(QString dirName);
0024   WebDAVReply* copy(QString destination);
0025   WebDAVReply* move(QString destination, bool overwrite = false);
0026   WebDAVReply* remove();
0027 
0028   QString toString();
0029 
0030   QString getHref();
0031   QDateTime getCreationDate();
0032   QString getLastModified();
0033   QString getDisplayName();
0034   QString getContentType();
0035   int getContentLength();
0036 
0037  private:
0038   WebDAV* webdavClient;
0039   QString href;
0040   QDateTime creationDate;
0041   QString lastModified;
0042   QString displayName;
0043   QString contentType;
0044   int contentLength;
0045 
0046   bool flagIsCollection;
0047 };
0048 
0049 #endif