class Net::DAV
Public Instance Methods
propfind_size(path)
click to toggle source
# File lib/adobe_crx/client.rb, line 23 def propfind_size(path) headers = {'Depth' => 'infinity'} body = '<?xml version="1.0" encoding="utf-8"?><DAV:propfind xmlns:DAV="DAV:"><DAV:prop><DAV:getcontentlength/></DAV:prop></DAV:propfind>' res = @handler.request(:propfind, path, body, headers) total_size = 0 xml = Nokogiri::XML.parse(res.body) namespaces = {'x' => "DAV:"} xml./('.//x:response', namespaces).each do |item| begin total_size = total_size + item.%(".//x:getcontentlength", namespaces).inner_text.to_i rescue Exception #nothing end end total_size end