14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/sp_2010.rb', line 14
def self.get_files(options={})
host = options[:host]
domain = options[:domain]
user = options[:user]
password = options[:password]
uri = URI.parse(host)
http = Net::HTTP.new(uri.host, uri.port)
if (use_ssl?(host))
http.use_ssl = true
end
req = Net::HTTP::Propfind.new(uri.request_uri)
if domain
req.ntlm_auth(user, domain, password)
else
req.basic_auth(user, password)
end
res = http.request(req)
FilesResponse.new(res)
end
|