def find(path, options = {})
      path = @uri.merge(path).path
      namespaces = {'x' => "DAV:"}
      begin
        doc = propfind(path)
      rescue Net::ProtocolError => e
        msg = e.to_s + ": " + path.to_s
        if(options[:suppress_errors])then
          # Ignore dir if propfind returns an error
          warn("Warning: " + msg)
          return nil
        else
          raise e.class.new(msg, nil)
        end
      end
      path.sub!(/\/$/, '')
      doc./('.//x:response', namespaces).each do |item|
        uri = @uri.merge(item.xpath("x:href", namespaces).inner_text)
        size = item.%(".//x:getcontentlength", namespaces).inner_text rescue nil
        type = item.%(".//x:collection", namespaces) ? :directory : :file
        res = Item.new(self, uri, type, size, item)
        if type == :file then

          if(options[:filename])then
            search_term = options[:filename]
            filename = File.basename(uri.path)
            if(search_term.class == Regexp and search_term.match(filename))then
              yield res
            elsif(search_term.class == String and search_term == filename)then
              yield res
            end
          else
            yield res
          end

        elsif uri.path == path || uri.path == path + "/"
          # This is the top-level dir, skip it
        elsif options[:recursive] && type == :directory

          if(!options[:filename])then
            yield res
          end

          # This is a subdir, recurse
          find(uri.path, options) do |sub_res|
            yield sub_res
          end
        else
          if(!options[:filename])then
            yield res
          end
        end
      end
    end
def find(path, options = {})
      path = @uri.merge(path).path
      namespaces = {'x' => "DAV:"}
      begin
        doc = propfind(path)
      rescue Net::ProtocolError => e
        msg = e.to_s + ": " + path.to_s
        if(options[:suppress_errors])then
          # Ignore dir if propfind returns an error
          warn("Warning: " + msg)
          return nil
        else
          raise e.class.new(msg, nil)
        end
      end
      path.sub!(/\/$/, '')
      doc./('.//x:response', namespaces).each do |item|
        uri = @uri.merge(item.xpath("x:href", namespaces).inner_text)
        size = item.%(".//x:getcontentlength", namespaces).inner_text rescue nil
        type = item.%(".//x:collection", namespaces) ? :directory : :file
        res = Item.new(self, uri, type, size, item)
        if type == :file then

          if(options[:filename])then
            search_term = options[:filename]
            filename = File.basename(uri.path)
            if(search_term.class == Regexp and search_term.match(filename))then
              yield res
            elsif(search_term.class == String and search_term == filename)then
              yield res
            end
          else
            yield res
          end

        elsif uri.path == path || uri.path == path + "/"
          # This is the top-level dir, skip it
        elsif options[:recursive] && type == :directory

          if(!options[:filename])then
            yield res
          end

          # This is a subdir, recurse
          find(uri.path, options) do |sub_res|
            yield sub_res
          end
        else
          if(!options[:filename])then
            yield res
          end
        end
      end
    end
Find files and directories, yields Net::DAV::Item

 The :filename option can be a regexp or string, and is used
 to filter the yielded items.

 If :suppress_errors is passed, exceptions that occurs when
 reading directory information is ignored, and a warning is
 printed out stderr instead.

 The default is to not traverse recursively, unless the :recursive
 options is passed.

 Examples:

  res = Net::DAV.start(url) do |dav|
    dav.find(url.path, :recursive => true) do |item|
      puts "#{item.type} #{item.uri}"
      puts item.content
    end
  end

  dav = Net::DAV.new(url)
  dav.find(url.path, :filename => /\.html/, :suppress_errors => true)
    puts item.url.to_s
  end