The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
WEBrick+WebDAV Handler Safely Extracted From the Wild

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Red Handed

Posts: 1158
Nickname: redhanded
Registered: Dec, 2004

Red Handed is a Ruby-focused group blog.
WEBrick+WebDAV Handler Safely Extracted From the Wild Posted: Jul 24, 2005 8:59 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Red Handed.
Original Post: WEBrick+WebDAV Handler Safely Extracted From the Wild
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Red Handed
Latest Posts From RedHanded

Advertisement

Adrian Madrid originally found this Ruby app called Sarada and posted it to del.icio.us. Sure enough, Tatsuki Sugiura is hiding all these great wares in his darcs repository, including a WebDAV handler for WEBrick! Uhm, let’s get this good candidate for the core distribution dusted off.

If you want to try it out, I’ve got a gem up: gem install webrick-webdav.

Here’s a sample WebDAV server, written by Sugiura:

 #!/usr/bin/ruby
 require 'rubygems'
 require 'webrick'
 require 'webrick/httpservlet/webdavhandler'

 log = WEBrick::Log.new
 log.level = WEBrick::Log::DEBUG if $DEBUG
 serv = WEBrick::HTTPServer.new({:Port => 10080, :Logger => log})
 serv.mount("/", WEBrick::HTTPServlet::WebDAVHandler, Dir.pwd)
 trap(:INT){ serv.shutdown }
 serv.start

I tested with cadaver localhost:10080 and listing, moving, removing, editing, putting, getting files is all there. There’s a buffer size message at the top of the source code mentioning trouble with large files, but I was able to transfer eight megs with no trouble at all. I think the comment refers to a bugfix the author made. Holy cats!

Keep in mind: it requires iconv due to the compatibility the handler tries to ensure among Konqueror, gnome-vfs, Windows, etc.

Read: WEBrick+WebDAV Handler Safely Extracted From the Wild

Topic: Bangalore Previous Topic   Next Topic Topic: Thar be felines here

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use