Parent

Methods

Class/Module Index [+]

Quicksearch

PropfindCLI

Public Class Methods

propfind(args) click to toggle source
# File lib/davclient/dav-propfind.rb, line 8
def self.propfind(args)
  options = read_options(args)

  url = args[0]
  if(not(url)) then
    url = WebDAV.CWURL
  end

  if(not(url)) then
    puts "Error: Missing mandatory url"
    puts optparse
    exit
  end

  if(options[:xml])then
    puts WebDAV.propfind(url, :xml => true)
  else

    # TODO This is experimental code in desperat need
    # of love and attention
    item = WebDAV.propfind(url)
    puts item.collection

    prev_url = nil
    WebDAV.find(url, :children => options[:children]) do | url, item |
      if(prev_url != url) then
        puts
        puts "url = " + url.to_s
        prev_url = url
      end

      name = item.prefix
      if(item.namespace)then
        name = name + "(" + item.namespace + ")"
      end
      name = name + item.name
      puts name.ljust(40) + " = '" + item.text.to_s + "'"
    end

  end

end

[Validate]

Generated with the Darkfish Rdoc Generator 2.