-
Notifications
You must be signed in to change notification settings - Fork 4
/
ACFTPClient.h
58 lines (44 loc) · 2.23 KB
/
ACFTPClient.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//
// FTPClient.h
// OnSong
//
// Created by Jason Kichline on 3/23/11.
// Copyright 2011 andCulture. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ACFTPLocation.h"
#import "ACFTPListRequest.h"
#import "ACFTPGetRequest.h"
#import "ACFTPPutRequest.h"
#import "ACFTPMakeDirectoryRequest.h"
#import "ACFTPDeleteFileRequest.h"
@class ACFTPClient;
@protocol ACFTPClientDelegate
@optional
-(void)client:(ACFTPClient*)client request:(id)request didListEntries:(NSArray*)entries;
-(void)client:(ACFTPClient*)client request:(id)request didUpdateProgress:(float)progress;
-(void)client:(ACFTPClient*)client request:(id)request didDownloadFile:(NSURL*)sourceURL toDestination:(NSString*)destinationPath;
-(void)client:(ACFTPClient*)client request:(id)request didUploadFile:(NSString*)sourcePath toDestination:(NSURL*)destination;
-(void)client:(ACFTPClient*)client request:(id)request didMakeDirectory:(NSURL*)destination;
-(void)client:(ACFTPClient*)client request:(id)request didDeleteFile:(NSURL*)fileURL;
-(void)client:(ACFTPClient*)client request:(id)request didFailWithError:(NSError*)error;
-(void)client:(ACFTPClient*)client request:(id)request didUpdateStatus:(NSString*)status;
-(void)client:(ACFTPClient*)client requestDidCancel:(id)request;
@end
@interface ACFTPClient : NSObject <ACFTPListRequestDelegate, ACFTPGetRequestDelegate, ACFTPPutRequestDelegate, ACFTPMakeDirectoryRequestDelegate, ACFTPDeleteFileRequestDelegate> {
NSMutableArray* requests;
ACFTPLocation* location;
id<ACFTPClientDelegate> delegate;
}
@property (nonatomic, retain) ACFTPLocation* location;
@property (nonatomic, retain) id<ACFTPClientDelegate> delegate;
-(id)initWithHost:(NSString*)host username:(NSString*)username password:(NSString*)password;
-(id)initWithLocation:(ACFTPLocation*)location;
+(ACFTPClient*)clientWithHost:(NSString*)host username:(NSString*)username password:(NSString*)password;
+(ACFTPClient*)clientWithLocation:(ACFTPLocation*)location;
-(void)list:(NSString*)path;
-(void)get:(NSString*)sourcePath toDestination:(NSString*)destinationPath;
-(void)put:(NSString*)sourcePath toDestination:(NSString*)destinationPath;
-(void)makeDirectory:(NSString*) inParentDirectory:(NSString*)parentDirectory;
-(void)deleteFile:(NSString*)filePath;
@end