2013-12-05 05:57:44 +00:00
|
|
|
//
|
|
|
|
// LACamliClient.h
|
|
|
|
//
|
|
|
|
// Created by Nick O'Neill on 1/10/13.
|
|
|
|
// Copyright (c) 2013 The Camlistore Authors. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
2014-01-16 21:29:55 +00:00
|
|
|
@class LACamliFile, LACamliUploadOperation;
|
2014-01-05 02:50:35 +00:00
|
|
|
|
|
|
|
@protocol LACamliStatusDelegate <NSObject>
|
|
|
|
|
|
|
|
@optional
|
2014-02-07 00:45:54 +00:00
|
|
|
- (void)finishedDiscovery:(NSDictionary*)config;
|
2014-01-16 21:29:55 +00:00
|
|
|
- (void)addedUploadOperation:(LACamliUploadOperation*)op;
|
|
|
|
- (void)finishedUploadOperation:(LACamliUploadOperation*)op;
|
|
|
|
- (void)uploadProgress:(float)pct forOperation:(LACamliUploadOperation*)op;
|
2014-01-05 02:50:35 +00:00
|
|
|
@end
|
2013-12-05 05:57:44 +00:00
|
|
|
|
|
|
|
@interface LACamliClient : NSObject <NSURLSessionDelegate>
|
|
|
|
|
2014-01-16 21:29:55 +00:00
|
|
|
@property NSURLSessionConfiguration* sessionConfig;
|
2014-01-05 02:50:35 +00:00
|
|
|
@property id delegate;
|
2013-12-05 05:57:44 +00:00
|
|
|
|
2014-01-16 21:29:55 +00:00
|
|
|
@property NSURL* serverURL;
|
|
|
|
@property NSString* username;
|
|
|
|
@property NSString* password;
|
2013-12-05 05:57:44 +00:00
|
|
|
|
2014-01-16 21:29:55 +00:00
|
|
|
@property NSString* blobRootComponent;
|
|
|
|
@property NSOperationQueue* uploadQueue;
|
2013-12-24 05:36:10 +00:00
|
|
|
@property NSUInteger totalUploads;
|
2013-12-05 05:57:44 +00:00
|
|
|
|
2014-02-09 22:02:00 +00:00
|
|
|
@property NSMutableArray* uploadedFileNames;
|
2013-12-09 04:50:03 +00:00
|
|
|
@property UIBackgroundTaskIdentifier backgroundID;
|
2013-12-05 05:57:44 +00:00
|
|
|
|
|
|
|
@property BOOL isAuthorized;
|
|
|
|
@property BOOL authorizing;
|
|
|
|
|
2014-01-16 21:29:55 +00:00
|
|
|
- (id)initWithServer:(NSURL*)server username:(NSString*)username andPassword:(NSString*)password;
|
2013-12-13 18:57:43 +00:00
|
|
|
- (BOOL)readyToUpload;
|
2014-01-16 21:29:55 +00:00
|
|
|
- (void)discoveryWithUsername:(NSString*)user andPassword:(NSString*)pass;
|
2013-12-05 05:57:44 +00:00
|
|
|
|
2014-02-09 22:02:00 +00:00
|
|
|
- (BOOL)fileAlreadyUploaded:(NSString*)filename;
|
2014-01-16 21:29:55 +00:00
|
|
|
- (void)addFile:(LACamliFile*)file withCompletion:(void (^)())completion;
|
2013-12-05 05:57:44 +00:00
|
|
|
|
2014-01-16 21:29:55 +00:00
|
|
|
- (NSURL*)statURL;
|
|
|
|
- (NSURL*)uploadURL;
|
2013-12-05 05:57:44 +00:00
|
|
|
|
|
|
|
@end
|