123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- #import "DBSession.h"
- @protocol DBRestClientDelegate;
- @class DBAccountInfo;
- @class DBMetadata;
- @interface DBRestClient : NSObject {
- DBSession* session;
- NSString* userId;
- NSString* root;
- NSMutableSet* requests;
-
- NSMutableDictionary* loadRequests;
- NSMutableDictionary* imageLoadRequests;
- NSMutableDictionary* uploadRequests;
- id<DBRestClientDelegate> delegate;
- }
- - (id)initWithSession:(DBSession*)session;
- - (id)initWithSession:(DBSession *)session userId:(NSString *)userId;
- - (void)cancelAllRequests;
- - (void)loadMetadata:(NSString*)path withHash:(NSString*)hash;
- - (void)loadMetadata:(NSString*)path;
- - (void)loadMetadata:(NSString *)path atRev:(NSString *)rev;
- - (void)loadDelta:(NSString *)cursor;
- - (void)loadFile:(NSString *)path intoPath:(NSString *)destinationPath;
- - (void)loadFile:(NSString *)path atRev:(NSString *)rev intoPath:(NSString *)destPath;
- - (void)cancelFileLoad:(NSString*)path;
- - (void)loadThumbnail:(NSString *)path ofSize:(NSString *)size intoPath:(NSString *)destinationPath;
- - (void)cancelThumbnailLoad:(NSString*)path size:(NSString*)size;
- - (void)uploadFile:(NSString *)filename toPath:(NSString *)path withParentRev:(NSString *)parentRev
- fromPath:(NSString *)sourcePath;
- - (void)cancelFileUpload:(NSString *)path;
- - (void)uploadFile:(NSString*)filename toPath:(NSString*)path fromPath:(NSString *)sourcePath __attribute__((deprecated));
- - (void)uploadFileChunk:(NSString *)uploadId offset:(unsigned long long)offset fromPath:(NSString *)localPath;
- - (void)uploadFile:(NSString *)filename toPath:(NSString *)parentFolder withParentRev:(NSString *)parentRev
- fromUploadId:(NSString *)uploadId;
- - (void)loadRevisionsForFile:(NSString *)path;
- - (void)loadRevisionsForFile:(NSString *)path limit:(NSInteger)limit;
- - (void)restoreFile:(NSString *)path toRev:(NSString *)rev;
- - (void)createFolder:(NSString*)path;
- - (void)deletePath:(NSString*)path;
- - (void)copyFrom:(NSString*)fromPath toPath:(NSString *)toPath;
- - (void)createCopyRef:(NSString *)path;
- - (void)copyFromRef:(NSString*)copyRef toPath:(NSString *)toPath;
- - (void)moveFrom:(NSString*)fromPath toPath:(NSString *)toPath;
- - (void)loadAccountInfo;
- - (void)searchPath:(NSString*)path forKeyword:(NSString*)keyword;
- - (void)loadSharableLinkForFile:(NSString *)path;
- - (void)loadSharableLinkForFile:(NSString *)path shortUrl:(BOOL)createShortUrl;
- - (void)loadStreamableURLForFile:(NSString *)path;
- - (NSUInteger)requestCount;
- @property (nonatomic, assign) id<DBRestClientDelegate> delegate;
- @end
- @protocol DBRestClientDelegate <NSObject>
- @optional
- - (void)restClient:(DBRestClient*)client loadedMetadata:(DBMetadata*)metadata;
- - (void)restClient:(DBRestClient*)client metadataUnchangedAtPath:(NSString*)path;
- - (void)restClient:(DBRestClient*)client loadMetadataFailedWithError:(NSError*)error;
- - (void)restClient:(DBRestClient*)client loadedDeltaEntries:(NSArray *)entries reset:(BOOL)shouldReset cursor:(NSString *)cursor hasMore:(BOOL)hasMore;
- - (void)restClient:(DBRestClient*)client loadDeltaFailedWithError:(NSError *)error;
- - (void)restClient:(DBRestClient*)client loadedAccountInfo:(DBAccountInfo*)info;
- - (void)restClient:(DBRestClient*)client loadAccountInfoFailedWithError:(NSError*)error;
- - (void)restClient:(DBRestClient*)client loadedFile:(NSString*)destPath;
- - (void)restClient:(DBRestClient*)client loadedFile:(NSString*)destPath contentType:(NSString*)contentType metadata:(DBMetadata*)metadata;
- - (void)restClient:(DBRestClient*)client loadProgress:(CGFloat)progress forFile:(NSString*)destPath;
- - (void)restClient:(DBRestClient*)client loadFileFailedWithError:(NSError*)error;
- - (void)restClient:(DBRestClient*)client loadedThumbnail:(NSString*)destPath metadata:(DBMetadata*)metadata;
- - (void)restClient:(DBRestClient*)client loadThumbnailFailedWithError:(NSError*)error;
- - (void)restClient:(DBRestClient*)client uploadedFile:(NSString*)destPath from:(NSString*)srcPath
- metadata:(DBMetadata*)metadata;
- - (void)restClient:(DBRestClient*)client uploadProgress:(CGFloat)progress
- forFile:(NSString*)destPath from:(NSString*)srcPath;
- - (void)restClient:(DBRestClient*)client uploadFileFailedWithError:(NSError*)error;
- - (void)restClient:(DBRestClient *)client uploadedFileChunk:(NSString *)uploadId newOffset:(unsigned long long)offset
- fromFile:(NSString *)localPath expires:(NSDate *)expiresDate;
- - (void)restClient:(DBRestClient *)client uploadFileChunkFailedWithError:(NSError *)error;
- - (void)restClient:(DBRestClient *)client uploadFileChunkProgress:(CGFloat)progress
- forFile:(NSString *)uploadId offset:(unsigned long long)offset fromPath:(NSString *)localPath;
- - (void)restClient:(DBRestClient *)client uploadedFile:(NSString *)destPath fromUploadId:(NSString *)uploadId
- metadata:(DBMetadata *)metadata;
- - (void)restClient:(DBRestClient *)client uploadFromUploadIdFailedWithError:(NSError *)error;
- - (void)restClient:(DBRestClient*)client uploadedFile:(NSString*)destPath from:(NSString*)srcPath;
- - (void)restClient:(DBRestClient*)client loadedFile:(NSString*)destPath contentType:(NSString*)contentType;
- - (void)restClient:(DBRestClient*)client loadedThumbnail:(NSString*)destPath;
- - (void)restClient:(DBRestClient*)client loadedRevisions:(NSArray *)revisions forFile:(NSString *)path;
- - (void)restClient:(DBRestClient*)client loadRevisionsFailedWithError:(NSError *)error;
- - (void)restClient:(DBRestClient*)client restoredFile:(DBMetadata *)fileMetadata;
- - (void)restClient:(DBRestClient*)client restoreFileFailedWithError:(NSError *)error;
- - (void)restClient:(DBRestClient*)client createdFolder:(DBMetadata*)folder;
- - (void)restClient:(DBRestClient*)client createFolderFailedWithError:(NSError*)error;
- - (void)restClient:(DBRestClient*)client deletedPath:(NSString *)path;
- - (void)restClient:(DBRestClient*)client deletePathFailedWithError:(NSError*)error;
- - (void)restClient:(DBRestClient*)client copiedPath:(NSString *)fromPath to:(DBMetadata *)to;
- - (void)restClient:(DBRestClient*)client copyPathFailedWithError:(NSError*)error;
- - (void)restClient:(DBRestClient*)client createdCopyRef:(NSString *)copyRef forPath:(NSString *)path;
- - (void)restClient:(DBRestClient*)client createCopyRefFailedWithError:(NSError *)error;
- - (void)restClient:(DBRestClient*)client createdCopyRef:(NSString *)copyRef;
- - (void)restClient:(DBRestClient*)client copiedRef:(NSString *)copyRef to:(DBMetadata *)to;
- - (void)restClient:(DBRestClient*)client copyFromRefFailedWithError:(NSError*)error;
- - (void)restClient:(DBRestClient*)client movedPath:(NSString *)from_path to:(DBMetadata *)result;
- - (void)restClient:(DBRestClient*)client movePathFailedWithError:(NSError*)error;
- - (void)restClient:(DBRestClient*)restClient loadedSearchResults:(NSArray*)results
- forPath:(NSString*)path keyword:(NSString*)keyword;
- - (void)restClient:(DBRestClient*)restClient searchFailedWithError:(NSError*)error;
- - (void)restClient:(DBRestClient*)restClient loadedSharableLink:(NSString*)link
- forFile:(NSString*)path;
- - (void)restClient:(DBRestClient*)restClient loadSharableLinkFailedWithError:(NSError*)error;
- - (void)restClient:(DBRestClient*)restClient loadedStreamableURL:(NSURL*)url forFile:(NSString*)path;
- - (void)restClient:(DBRestClient*)restClient loadStreamableURLFailedWithError:(NSError*)error;
- @end
|