AFWebDAVManager 0.0.1

AFWebDAVManager 0.0.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Mar 2015

Maintained by Mattt Thompson, Kevin Harwood.


Downloads

Total4,287
Week0
Month118

Installs

Apps99
Test Targets12
powered by Segment

GitHub

Stars50
Watchers1
Forks17
Issues2
Contributors2
Pull Requests3

Code

Files2
LOCLines of Code 541


 
Depends on:
AFNetworking~> 2.4
Ono~> 1.1
 

AFWebDAVManager is an AFHTTPRequestOperationManager subclass for interacting with the WebDAV.

Caution: This code is still in its early stages of development, so exercise caution when incorporating this into production code.

Example Usage

AFWebDAVManager *webDAVManager = [[AFWebDAVManager alloc] initWithBaseURL:[NSURL URLWithString:@"http://example.com"]];
webDAVManager.credential = [NSURLCredential credentialWithUser:@"username"
                                                      password:@"Pa55word"
                                                   persistence:NSURLCredentialPersistenceForSession];

[webDAVManager createFileAtURLString:@"/path/to/file.txt"
         withIntermediateDirectories:YES
                            contents:[@"Hello, World" dataUsingEncoding:NSUTF8StringEncoding]
                   completionHandler:^(NSURL *fileURL, NSError *error)
{
    if (error) {
        NSLog(@"[Error] %@", error);
    } else {
        NSLog(@"File created: %@", fileURL);
    }
}];

[webDAVManager contentsOfDirectoryAtURLString:@"/path"
                                    recursive:NO
                            completionHandler:^(NSArray *items, NSError *error)
{
    if (error) {
        NSLog(@"[Error] %@", error);
    } else {
        NSLog(@"Items: %@", items);
    }
}];

Contact

Mattt Thompson

License

AFWebDAVManager is available under the MIT license. See the LICENSE file for more info.