Ruby, iOS, and Other Development

A place to share useful code snippets, ideas, and techniques

All code in posted articles shall be considered public domain unless otherwise noted.
Comments remain the property of their authors.

2010-03-26

What WebDAV Enables

I have lots of ideas for iPhone apps. Ideas, of course, are a dime a dozen unless you execute on them. When I choose an app idea to execute, I base that choice on what I can do with a reasonable level of effort since I have to fit it into my free time. That means that I've shelved all of the ideas that require a WebDAV client.

All sorts of things would benefit from writing to or reading from a network-accessible filesystem, from a simple TODO list (I'd considered implementing TaskPaper, for example) to a game with user-generated levels. I'm thinking in terms of WebDAV for a few reasons:

  • MobileMe's iDisk is a WebDAV filesystem
  • So is a subversion server
  • WebDAV works equally well over a VPN, through a proxy, to a remote server, or over a LAN
  • There are already a number of iPhone apps that provide a WebDAV share

The problem is that no suitable WebDAV library exists. There are C codebases that might do the job (e.g. neon and cadaver), but they are licensed under the GPL. That's an inconvenient license for software going into a commercial iPhone app. Here's a list of requirements to define what I consider suitable:

  • Its license must be MIT, BSD, Apache, LGPL, or something similarly non-viral and free.
  • It must be based on the NSURL* class family so that it picks up and uses the iPhone's current proxy settings. ASIHTTP* is not acceptable.
  • It must provide a reasonably simple Objective-C interface to:
    • reading files
    • writing files (guaranteeing, by default, atomicity via both explicit WebDAV locking and ETags)
    • listing directories (including files' MIME types)
    • reading byte ranges, i.e. partial file reading
  • It must be easy to build a static fat library for iPhone, iPad, and simulator, preferably because the source is delivered with an Xcode project file

If anyone is interested in implementing and licensing such a library according to the requirements above, I'll offer a bounty of US$50. If I get enough (non-anonymous) comments on this post with pledges to increase that bounty to a total of $200 or more, I'll set up a bounty fund and open it to contributions.

To claim the bounty, comment on this post with an URL pointing to your repository on Sourceforge, Google Code, Github, or something similar and I'll check it out. Payment will probably be via Paypal.

Yes, I feel a little silly offering a bounty when I could implement it myself, but since I haven't found the time in the course of nearly two years, I don't see that changing. This way, we can all benefit. Enjoy!

Update! Apache Jackrabbit includes an Apache-licensed (of course) WebDAV client library... in Java. A port might be easier than starting from scratch.

Labels: ,

6 Comments:

  • At 5/27/2010 03:15:00 AM, Blogger pghcoder said…

    Have you looked at ConnectionKit?

    http://opensource.utr-software.com/connection/

    It uses the BSD license and as far as I've looked at it, uses NSURL*.

     
  • At 5/27/2010 07:43:00 AM, Blogger Gregory said…

    I had looked at ConnectionKit at some point way back. I don't remember why I didn't go with it then, and I'd completely forgotten about it. I'm going to look into it again, and I'll update the blog post if it does what I need.

     
  • At 1/26/2011 01:30:00 AM, Anonymous Adam Lang said…

    ConnectionKit is a nightmare. I spent a good three hours looking at it, and concluded that it would take less time to write a WebDAV library that could do a simple put and mkcol than it would to try to figure out ConnectionKit with crappy documentation, instructions like 'choose your branch carefully' but no indications of the difference between branches, and so on.

    If you should happen to work on a WebDAV library, let me know. I can at the very least help you out with some of the debugging, as I worked with Lisa Dusseault (the writer of pretty much the only decent book on WebDAV programming) and did a lot of wire-level debugging and diagnostics of a WebDAV server product used with Apple's built-in WebDAV client.

    If you don't decide to work on one, it might still be worth your contacting me... I am going to at least be implementing a small subset of the WebDAV commands for my current iPhone project, you might be able to use that. Email me. My email address is my first initial and last name at lap-tech.com.

     
  • At 2/15/2011 05:37:00 PM, Blogger Dallas said…

    I am looking for this exact thing as well. Have you since found a library or created a non GPL licensed version?

     
  • At 2/23/2011 08:47:00 AM, Blogger Gregory said…

    I have not had a chance to do much iOS development recently. I am no longer employed as an iOS developer, and becoming a father has really cut into my free time. I have heard rumors that the existing NSFile stuff will do WebDAV (at least reading and writing, though I'm not sure about locking) if you give it an HTTP/HTTPS URL instead of a file: URL, but I haven't had a chance to put together a test. I also haven't had a chance to look into ConnectionKit again.

     
  • At 5/20/2011 11:33:00 AM, Anonymous mark fleming said…

    Other code...

    HTTP (need WebDAV commands added)
    http://allseeing-i.com/ASIHTTPRequest/


    New WebDAV Client for iOS..
    http://code.google.com/p/wtclient/

     

Post a Comment

Links to this post:

Create a Link

<< Home