00001 #ifndef FTPFILESERVER_H
00002 #define FTPFILESERVER_H
00003
00004 #include <QFtp>
00005 #include <QObject>
00006 #include "fileserver.h"
00007
00008 class MainWindow;
00009
00010 class FTPFileServer : public QObject, public FileServer
00011 {
00012 Q_OBJECT
00013 public:
00014 explicit FTPFileServer(QObject *parent = 0);
00015 ~FTPFileServer();
00016
00017 private:
00018
00019 QFtp *ftp;
00020 QString currentUrlString;
00021 QString currentServerAddress;
00022
00023 private Q_SLOTS:
00024 void ftpCommandFinished(int commandId, bool error);
00025 void ftpCommandListFinished(const QUrlInfo &urlInfo);
00026
00027
00028 public:
00030 QStringList getFileInfoLabels();
00031
00033 void updateFileList(QString URL);
00034
00036 QVector<ARCFileElement> &getFileList() { return fileList; }
00037
00039 bool goUpOneFolder();
00040
00042 QString getCurrentURL();
00043
00045 QString getCurrentPath();
00046
00048 bool copyFromServer(QString sourcePath, QString destinationPath);
00049
00051 bool copyToServer(QString sourcePath, QString destinationPath);
00052
00054 bool copyToServer(QList<QUrl> &urlList, QString destinationPath);
00055
00057 bool deleteItem(QString path);
00058
00060 bool makeDir(QString path);
00061
00063 unsigned int getFilePermissions(QString path);
00064
00066 void setFilePermissions(QString path, unsigned int permissions);
00067
00068 virtual bool deleteItems(QStringList& paths) {return false;}
00069
00070 };
00071
00072 #endif // FTPFILESERVER_H