QtsHttp  0.9.4
QtsHttpFileStation.h
1 //
2 // QtsHttpFileStation.h
3 // QTSHTTPSDK
4 //
5 // Created by Lawrence on 2013/11/24.
6 // Copyright (c) 2013年 Lawrence. All rights reserved.
7 //
8 
9 #import <Foundation/Foundation.h>
10 #import "QtsHttpComm.h"
11 
13 typedef enum _QTS_HTTP_FILE_STATION_API_VERSION_
14 {
16  QTS_HTTP_FILE_STATION_API_VERSION_UNKNOW = 0,
18  QTS_HTTP_FILE_STATION_API_V1 = 1,
19  //QTS_FILESTATION_V2 = 2,
20 }QTS_HTTP_FILE_STATION_API_VERSION;
21 
23 typedef enum _QTS_HTTP_FILE_STATION_COMPRESS_FORMAT_TYPE_
24 {
26  QTS_HTTP_FILE_STATION_COMPRESS_FORMAT_TYPE_ZIP = 0,
28  QTS_HTTP_FILE_STATION_COMPRESS_FORMAT_TYPE_7Z = 1,
29 }QTS_HTTP_FILE_STATION_COMPRESS_FORMAT_TYPE;
30 
32 typedef enum _QTS_HTTP_FILE_STATION_COMPRESS_LEVEL_
33 {
35  QTS_HTTP_FILE_STATION_COMPRESS_LEVEL_NORMAL = 0,
37  QTS_HTTP_FILE_STATION_COMPRESS_LEVEL_LARGE,
39  QTS_HTTP_FILE_STATION_COMPRESS_LEVEL_FAST,
40 }QTS_HTTP_FILE_STATION_COMPRESS_LEVEL;
41 
43 typedef enum _QTS_HTTP_FILE_STATION_COMPRESS_ENCRYPT_TYPE_
44 {
46  QTS_HTTP_FILE_STATION_COMPRESS_ENCRYPT_TYPE_AES256 = 0,
48  QTS_HTTP_FILE_STATION_COMPRESS_ENCRYPT_TYPE_ZIPCRYPTO,
49 }QTS_HTTP_FILE_STATION_COMPRESS_ENCRYPT_TYPE;
50 
52 typedef enum _QTS_HTTP_FILE_STATION_COMPRESS_UPDATE_MODE_
53 {
55  QTS_HTTP_FILE_STATION_COMPRESS_UPDATE_MODE_ADD_REPLACE = 0,
57  QTS_HTTP_FILE_STATION_COMPRESS_UPDATE_MODE_UPDATE_ADD,
59  QTS_HTTP_FILE_STATION_COMPRESS_UPDATE_MODE_UPDATE_EXISTING,
61  QTS_HTTP_FILE_STATION_COMPRESS_UPDATE_MODE_UPDATE_SYNCHRONIZE,
62 }QTS_HTTP_FILE_STATION_COMPRESS_UPDATE_MODE;
63 
65 typedef enum _QTS_HTTP_FILE_STATION_OVERWRITE_
66 {
68  QTS_HTTP_FILE_STATION_OVERWRITE_SKIP = 0,
70  QTS_HTTP_FILE_STATION_OVERWRITE_OVERWRITE,
71 }QTS_HTTP_FILE_STATION_OVERWRITE;
72 
74 typedef enum _QTS_HTTP_FILE_STATION_EXTRACT_PATH_MODE_
75 {
77  QTS_HTTP_FILE_STATION_EXTRACT_PATH_MODE_NONE = 0,
79  QTS_HTTP_FILE_STATION_EXTRACT_PATH_MODE_FULL,
80 }QTS_HTTP_FILE_STATION_EXTRACT_PATH_MODE;
81 
83 typedef enum _QTS_HTTP_FILE_STATION_EXTRACT_MODE_
84 {
86  QTS_HTTP_FILE_STATION_EXTRACT_MODE_ALL = 0,
88  QTS_HTTP_FILE_STATION_EXTRACT_MODE_PART,
89 }QTS_HTTP_FILE_STATION_EXTRACT_MODE;
90 
92 typedef enum _QTS_HTTP_FILE_STATION_THUMBNAIL_SIZE_
93 {
95  QTS_HTTP_FILE_STATION_THUMBNAIL_SIZE_LARGE = 0,
97  QTS_HTTP_FILE_STATION_THUMBNAIL_SIZE_MEDIUM = 1,
99  QTS_HTTP_FILE_STATION_THUMBNAIL_SIZE_SMALL = 2
100 }QTS_HTTP_FILE_STATION_THUMBNAIL_SIZE;
101 @interface QNQtsHttpFileEntry : NSObject
102 {
103  BOOL isDir;
104  long long size;
105  NSString* path;
106  NSString* name;
107 }
108 
109 @property (assign) BOOL isDir;
110 @property (assign) long long size;
111 @property (strong) NSString* path;
112 @property (strong) NSString* name;
129 -(id) initWithPath:(NSString*)path name:(NSString*)name size:(long long)size isDir:(BOOL)isDir;
130 @end
131 
132 @interface QNQtsHttpShareLinkInfo : NSObject
133 {
134  NSString* shareFilePath;
135  NSString* password;
136  NSString* dateTime;
137  BOOL useSSL;
138 }
139 
140 @property (strong) NSString* shareFilePath;
141 @property (strong) NSString* password;
142 @property (strong) NSString* dateTime;
143 @property (assign) BOOL useSSL;
160 -(id) initWithFilePath:(NSString*)filePath password:(NSString*)password datetime:(NSString*)dateTime useSSL:(BOOL)useSSL;
161 @end
162 
163 @interface QNQtsHttpFileStatus : NSObject
164 {
165  BOOL isDir;
167  long long size;
168  NSString* folderPermission;
169  NSString* path;
170  NSString* name;
171  NSString* group;
172  NSString* owner;
173  NSString* mt;
174 }
175 
176 @property (assign) BOOL isDir;
177 @property (assign) BOOL isCompressed;
178 @property (assign) long long size;
179 @property (strong) NSString* folderPermission;
180 @property (strong) NSString* path;
181 @property (strong) NSString* name;
182 @property (strong) NSString* group;
183 @property (strong) NSString* owner;
184 @property (strong) NSString* mt;
211 -(id) initWithPath:(NSString*)path name:(NSString*)name isDir:(BOOL)isDir
212  isCompressed:(BOOL)isCompressed size:(long long)size folderPermission:(NSString*)folderPermission group:(NSString*)group owner:(NSString*)owner mt:(NSString*)mt;
213 @end
214 
215 @interface QNQtsHttpShareLink : NSObject
216 {
217  NSString* fileName;
218  NSString* expireTime;
219  NSString* url;
220 }
221 
222 @property (strong) NSString* fileName;
223 @property (strong) NSString* expireTime;
224 @property (strong) NSString* url;
239 -(id) initWithFileName:(NSString*)_filename expireTime:(NSString*)_expireTime url:(NSString*)_url;
240 @end
241 
242 @interface QNQtsHttpExtractEntry : NSObject
243 {
244  BOOL isDir;
245  long long size;
246  long long compressSize;
247  NSString* modifyTime;
248  NSString* fileName;
249 }
250 
251 @property (assign) BOOL isDir;
252 @property (assign) long long size;
253 @property (assign) long long compressSize;
254 @property (strong) NSString* modifyTime;
255 @property (strong) NSString* fileName;
257 @end
258 
259 @interface QNQtsHttpNASInfo : NSObject
260 {
261  NSString* myCloudNasName;
262  NSString* nasExternalIP;
263  NSString* nasLocalIP;
264  NSString* nasHosstIP;
265 }
282 -(id) initWithMyCloudNasName:(NSString*)strMyCloudNasNamw nasExternalIP:(NSString*)strNasExternalIP nasLocalIP:(NSString*)strNasLocalIP nasHostIP:(NSString*)strNasHostIP;
283 @end
284 
285 
286 
287 @interface QNShareMember : NSObject
288 
289 @property (strong,nonatomic) NSString *name;
290 @property (strong,nonatomic) NSNumber *share_member;
291 @property (strong,nonatomic) NSNumber *event_status;
292 @property (strong,nonatomic) NSNumber *event_id;
293 
294 @end
295 
296 
297 
305 @protocol IQtsHttpFileStation <NSObject>
306 @optional
307 
324 -(void) getShareFolderListWithCommunicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
325 
348 -(void) getFileListCountWithPath:(NSString*)path communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
349 
376 -(void) getFileListWithPath:(NSString*)path indexFrom:(int)startIdx fileLimit:(int)fileLimit communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
377 
400 -(void) uploadFileWithPath:(NSString*)fromFilePath toPath:(NSString*)toFilePath communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail progress:(void(^)(int rateOfUploading, unsigned long long bytesOfUploading))block;
401 
426 -(void) downloadFile:(QNQtsHttpFileEntry*)fileEntry toPath:(NSString*)toFilePath offset:(long)offset communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail progress:(void(^)(int rateOfDownloading, unsigned long long bytesOfDownloading))block;
427 
452 -(void) downloadFileWithPath:(NSString*)path toPath:(NSString*)toFilePath offset:(long)offset communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail progress:(void(^)(int rateOfDownloading, unsigned long long bytesOfDownloadloading))block;
453 
473 -(void) createShareLink:(QNQtsHttpShareLinkInfo*)shareLinkInfo communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
474 
494 -(void) getShareLinkListWithFileLimit:(int)fileLimit communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
495 
514 -(void) deleteShareLink:(QNQtsHttpShareLink*)shareLink communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
515 
536 -(void) createFolderWithParentFolder:(QNQtsHttpFileEntry*)parentFolderEntry name:(NSString*)folderName communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
537 
562 -(void) copyFile:(QNQtsHttpFileEntry*)fileEntry toPath:(NSString*)toPath mode:(int)mode communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail progress:(void(^)(int rateOfCopy))block;
563 
588 -(void) moveFile:(QNQtsHttpFileEntry*)fileEntry toPath:(NSString*)toPath mode:(int)mode communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail progress:(void(^)(int rateOfMove))block;
589 
608 -(void) deleteFile:(QNQtsHttpFileEntry*)fileEntry communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
609 
630 -(void) createFolderWithPath:(NSString*)folderPath name:(NSString*)folderName communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
631 
656 -(void) copyFileWithPath:(NSString*)fromPath toPath:(NSString*)toPath mode:(int)mode communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail progress:(void(^)(int rateOfCopy))block;
657 
682 -(void) moveFileWithPath:(NSString*)fromPath toPath:(NSString*)toPath mode:(int)mode communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail progress:(void(^)(int rateOfMove))block;
683 
702 -(void) deleteFileWithPath:(NSString*)filePath communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
703 
728 -(void) searchFileWithKeyword:(NSString*)keyword rootFolder:(NSString*)folderPath fileLimit:(int)fileLimit communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
729 
749 -(void) getFileStatusWithPath:(NSString*)filePath communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
750 
770 -(void) createChunkedUploadIdWithPath:(NSString*)uploadTempPath communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
771 
800 -(void) chunkedUploadFileWithPath:(NSString*)uploadFilePath toPath:(NSString*)toFilePath fileName:(NSString*)renameOriDestFileName uploadID:(NSString*)uploadID uploadTempPath:(NSString*)uploadTempPath communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail progress:(void(^)(int rateOfUploading, unsigned long long bytesOfUploading))block;
801 
822 -(void) deleteChunkedUploadFileWithId:(NSString*)uploadID uploadTempPath:(NSString*)uploadTempPath communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
823 
844 -(void) renameFileWithPath:(NSString*)filePath fileName:(NSString*)newName communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
845 
866 -(void) updateFileModifyDateWithFilePath:(NSString*)filePath modifyTime:(long)modifyTime communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
867 
902 -(void) compressFilesName:(NSString*)compressName path:(NSString*)compressFilePath numberOfFiles:(int)totalFileNum fileList:(NSMutableArray*)fileList compressType:(QTS_HTTP_FILE_STATION_COMPRESS_FORMAT_TYPE)compressFormat password:(NSString*)password compressLevel:(QTS_HTTP_FILE_STATION_COMPRESS_LEVEL)compressLevel compressEncryrtType:(QTS_HTTP_FILE_STATION_COMPRESS_ENCRYPT_TYPE)encryptType compressUpdateMode:(QTS_HTTP_FILE_STATION_COMPRESS_UPDATE_MODE)updateMode communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
903 
927 -(void) ListContentsOfExtractedFilePath:(NSString*)filePath start:(int)startIdx limit:(int)fileLimit communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
928 
961 -(void) ExtractFiles:(QNQtsHttpFileEntry*)extractedFile toPath:(NSString*)toPath password:(NSString*)password exractMode:(QTS_HTTP_FILE_STATION_EXTRACT_MODE)extractMode partTotalFileCount:(int)partTotalFileCount partFileList:(NSMutableArray*)partFileList overwrite:(QTS_HTTP_FILE_STATION_OVERWRITE)overWrite extractPathMode:(QTS_HTTP_FILE_STATION_EXTRACT_PATH_MODE)extractPathMode communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
962 
980 -(void) getDomainIPListWithCommunicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
981 
1000 -(void) addVideoTranscodeWithFilePath:(NSString*)filePath communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
1001 
1020 -(void) deleteVideoTranscodeWithFilePath:(NSString*)filePath communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
1021 
1041 -(void) getFileURLWithFilePath:(NSString*)fileFullPath cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
1061 -(void) getImgThumbURLWithFilePath:(NSString*)fileFullPath cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
1062 
1063 -(void) getImgThumbURLWithFilePath:(NSString*)fileFullPath thumbnailSize:(QTS_HTTP_FILE_STATION_THUMBNAIL_SIZE)thumbnailSize cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
1064 
1065 -(void) getImgThumbURLWithFilePath:(NSString*)fileFullPath isSSL:(BOOL)isSSL thumbnailSize:(QTS_HTTP_FILE_STATION_THUMBNAIL_SIZE)thumbnailSize cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
1066 
1067 -(void) getImgThumbURLWithFile:(QNQtsHttpFileEntry*)entry thumbnailSize:(QTS_HTTP_FILE_STATION_THUMBNAIL_SIZE)thumbnailSize cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
1068 
1069 -(void) getImgThumbURLWithFile:(QNQtsHttpFileEntry*)entry isSSL:(BOOL)isSSL thumbnailSize:(QTS_HTTP_FILE_STATION_THUMBNAIL_SIZE)thumbnailSize cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail;
1070 
1071 -(void) downloadImgThumbWithFile:(QNQtsHttpFileEntry*)entry toPath:(NSString*)toFilePath thumbnailSize:(QTS_HTTP_FILE_STATION_THUMBNAIL_SIZE)thumbnailSize communicationMode:(BOOL)isAsync cancel:(int*)isCancel success:(void(^)(QTS_RESPONSE_CTX* response))success fail:(void(^)(QTS_HTTP_API_RESULTS error))fail progress:(void(^)(int rateOfDownloading, unsigned long long bytesOfDownloading))block;
1072 
1073 @end
1074 @interface QNQtsHttpFileStation : NSObject <IQtsHttpFileStation>
1075 @end
NSString * folderPermission
Definition: QtsHttpFileStation.h:168
NSString * name
Definition: QtsHttpFileStation.h:106
Definition: QtsHttpFileStation.h:101
NSString * nasLocalIP
Definition: QtsHttpFileStation.h:263
NSString * nasHosstIP
Definition: QtsHttpFileStation.h:264
NSString * name
Definition: QtsHttpFileStation.h:170
NSString * nasExternalIP
Definition: QtsHttpFileStation.h:262
NSString * fileName
Definition: QtsHttpFileStation.h:248
Definition: QtsHttpFileStation.h:1074
NSString * path
Definition: QtsHttpFileStation.h:105
NSString * group
Definition: QtsHttpFileStation.h:171
BOOL isCompressed
Definition: QtsHttpFileStation.h:166
long long size
Definition: QtsHttpFileStation.h:167
Content of API Response.
Definition: QtsHttpComm.h:61
Definition: QtsHttpFileStation.h:259
Definition: QtsHttpFileStation.h:242
long long compressSize
Definition: QtsHttpFileStation.h:246
Definition: QtsHttpFileStation.h:163
NSString * modifyTime
Definition: QtsHttpFileStation.h:247
NSString * path
Definition: QtsHttpFileStation.h:169
long long size
Definition: QtsHttpFileStation.h:104
long long size
Definition: QtsHttpFileStation.h:245
Definition: QtsHttpFileStation.h:287
NSString * owner
Definition: QtsHttpFileStation.h:172
NSString * mt
Definition: QtsHttpFileStation.h:173