23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/adobe_crx/client.rb', line 23
def propfind_size(path)
= {'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, )
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
end
end
total_size
end
|