<commit_before># GDFileManagerKit

[![Version](http://cocoapod-badges.herokuapp.com/v/GDFileManagerKit/badge.png)](http://cocoadocs.org/docsets/GDFileManagerKit)
[![Platform](http://cocoapod-badges.herokuapp.com/p/GDFileManagerKit/badge.png)](http://cocoadocs.org/docsets/GDFileManagerKit)

GDFileManagerKit lets you access Dropbox, Google Drive, SugarSync and WebDAV with a consistent,
NSFileManager-like API.

Features of GDFileManagerKit include:

* Persistent cached file metadata.  Old metadata is re-validated where possible making API calls more efficient.
* Cached file downloads.
* Chunked upload / downloads where available for reliability in intermittently connected environments.
* Copy/Delete/Move file operations.
* Aliases to keep track of files if the user moves / renames them remotely (requires a file service that supports persistent file identifiers like Google Drive or SugarSync).

While GDFileManagerKit is currently beta-quality software, it is used in my app [PocketBib].

## Usage

Get the contents of a directory:

    [[GDFileManager sharedManager] getContentsOfDirectoryAtURL:url success:^(NSArray *contents) {
        for (GDURLMetadata *metadata in contents) {
            NSLog(@"Found %@ called \"%@\"", [metadata isDirectory] ? @"folder" : @"file", metadata.filename);
        }
    
    } failure:^(NSError *error) {
        NSLog(@"error: %@", error);
    }];

Check the local cache for the file, download it if it has been updated, and cache the result:

    GDFileManager *fileManager = [GDFileManager new];
    GDFileManagerDownloadOperation *downloadOperation = [fileManager cachedDownloadOperationFromSourceURL:url
                                                                       success:^(NSURL *localURL, GDURLMetadata *metadata) {
                                                                           NSLog(@"success: %@; metadata = %@", localURL, metadata);
                                                                       } failure:^(NSError *error) {
                                                                           if ([[error domain] isEqualToString:NSURLErrorDomain] && [error code] == NSURLErrorCancelled) {
                                                                           } else
                                                                               NSLog(@"download failed: %@", error);
                                                                       }];
    [fileManager enqueueFileManagerOperation:downloadOperation];


See the included `GDFileManagerExample` for details.  To run the demo app, run `pod install`, and then open `GDFileManagerExample.xcworkspace` and build.

More details to come.

## Requirements

iOS 5.0+, various Pods.

## Author

<NAME>, <EMAIL>

## License

GDFileManagerKit is available under the MIT license. See the LICENSE file for more info.  If you require a non-attribution license, please contact me at <EMAIL>

# Donate

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="-----<KEY>END PKCS7-----
">
<input type="image" src="https://www.paypalobjects.com/en_AU/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalobjects.com/en_AU/i/scr/pixel.gif" width="1" height="1">
</form>


[PocketBib]: http://itunes.apple.com/app/pocketbib-for-bibtex-bibdesk/id524521749?ls=1&mt=8<commit_msg>Remove donate link as GitHub doesn't permit raw HTML (understandable).<commit_after># GDFileManagerKit

[![Version](http://cocoapod-badges.herokuapp.com/v/GDFileManagerKit/badge.png)](http://cocoadocs.org/docsets/GDFileManagerKit)
[![Platform](http://cocoapod-badges.herokuapp.com/p/GDFileManagerKit/badge.png)](http://cocoadocs.org/docsets/GDFileManagerKit)

GDFileManagerKit lets you access Dropbox, Google Drive, SugarSync and WebDAV with a consistent,
NSFileManager-like API.

Features of GDFileManagerKit include:

* Persistent cached file metadata.  Old metadata is re-validated where possible making API calls more efficient.
* Cached file downloads.
* Chunked upload / downloads where available for reliability in intermittently connected environments.
* Copy/Delete/Move file operations.
* Aliases to keep track of files if the user moves / renames them remotely (requires a file service that supports persistent file identifiers like Google Drive or SugarSync).

While GDFileManagerKit is currently beta-quality software, it is used in my app [PocketBib].

## Usage

Get the contents of a directory:

    [[GDFileManager sharedManager] getContentsOfDirectoryAtURL:url success:^(NSArray *contents) {
        for (GDURLMetadata *metadata in contents) {
            NSLog(@"Found %@ called \"%@\"", [metadata isDirectory] ? @"folder" : @"file", metadata.filename);
        }
    
    } failure:^(NSError *error) {
        NSLog(@"error: %@", error);
    }];

Check the local cache for the file, download it if it has been updated, and cache the result:

    GDFileManager *fileManager = [GDFileManager new];
    GDFileManagerDownloadOperation *downloadOperation = [fileManager cachedDownloadOperationFromSourceURL:url
                                                                       success:^(NSURL *localURL, GDURLMetadata *metadata) {
                                                                           NSLog(@"success: %@; metadata = %@", localURL, metadata);
                                                                       } failure:^(NSError *error) {
                                                                           if ([[error domain] isEqualToString:NSURLErrorDomain] && [error code] == NSURLErrorCancelled) {
                                                                           } else
                                                                               NSLog(@"download failed: %@", error);
                                                                       }];
    [fileManager enqueueFileManagerOperation:downloadOperation];


See the included `GDFileManagerExample` for details.  To run the demo app, run `pod install`, and then open `GDFileManagerExample.xcworkspace` and build.

More details to come.

## Requirements

iOS 5.0+, various Pods.

## Author

<NAME>, <EMAIL>

## License

GDFileManagerKit is available under the MIT license. See the LICENSE file for more info.  If you require a non-attribution license, please contact me at <EMAIL>


[PocketBib]: http://itunes.apple.com/app/pocketbib-for-bibtex-bibdesk/id524521749?ls=1&mt=8
{'fraction_non_alphanumeric': 0.09989484752891693, 'fraction_numerical': 0.0046567522908216915, 'mean_word_length': 2.390020366598778, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 3, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 58, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7258518', 'n_tokens_mistral': 1757, 'n_tokens_neox': 1654, 'n_words': 507}