Class: WebDAV
- Inherits:
-
Object
show all
- Defined in:
- lib/WebDAV/Error.rb,
lib/webdav.rb,
lib/WebDAV/VERSION.rb,
lib/WebDAV/Response.rb,
lib/WebDAV/MultiStatus.rb
Overview
WebDAV/Response.rb WebDAV::Response.rb
Defined Under Namespace
Classes: Error, MultiStatus, Response
Constant Summary
collapse
- VERSION =
'0.1.1'
Instance Method Summary
collapse
-
#copy(path, to:, depth: 'infinity', overwrite: true) ⇒ Object
-
#delete(path) ⇒ Object
-
#get(path) ⇒ Object
-
#head(path) ⇒ Object
-
#lock(path, body:) ⇒ Object
-
#mkcol(path) ⇒ Object
-
#move(path, to:, overwrite: true) ⇒ Object
-
#options(path = '/') ⇒ Object
-
#patch(path, body:, content_type: 'application/xml') ⇒ Object
-
#post(path, body:, content_type: 'application/xml') ⇒ Object
-
#propfind(path = '/', body: nil, depth: '1') ⇒ Object
-
#proppatch(path, body:) ⇒ Object
-
#put(path, body:, content_type: 'application/octet-stream') ⇒ Object
-
#report(path, body:, depth: '1') ⇒ Object
-
#trace(path) ⇒ Object
-
#unlock(path, token:) ⇒ Object
Instance Method Details
#copy(path, to:, depth: 'infinity', overwrite: true) ⇒ Object
44
45
46
47
48
49
50
51
|
# File 'lib/webdav.rb', line 44
def copy(path, to:, depth: 'infinity', overwrite: true)
response = request(:copy, path, headers: {
'Destination' => resolve_uri(to).to_s,
'Depth' => depth,
'Overwrite' => overwrite ? 'T' : 'F'
})
handle_response(response)
end
|
#delete(path) ⇒ Object
100
101
102
103
|
# File 'lib/webdav.rb', line 100
def delete(path)
response = request(:delete, path)
handle_response(response)
end
|
#get(path) ⇒ Object
75
76
77
78
|
# File 'lib/webdav.rb', line 75
def get(path)
response = request(:get, path)
handle_response(response)
end
|
#head(path) ⇒ Object
80
81
82
83
|
# File 'lib/webdav.rb', line 80
def head(path)
response = request(:head, path)
handle_response(response)
end
|
#lock(path, body:) ⇒ Object
63
64
65
66
|
# File 'lib/webdav.rb', line 63
def lock(path, body:)
response = request(:lock, path, body: body)
handle_response(response)
end
|
#mkcol(path) ⇒ Object
37
38
39
40
|
# File 'lib/webdav.rb', line 37
def mkcol(path)
response = request(:mkcol, path)
handle_response(response)
end
|
#move(path, to:, overwrite: true) ⇒ Object
53
54
55
56
57
58
59
|
# File 'lib/webdav.rb', line 53
def move(path, to:, overwrite: true)
response = request(:move, path, headers: {
'Destination' => resolve_uri(to).to_s,
'Overwrite' => overwrite ? 'T' : 'F'
})
handle_response(response)
end
|
#options(path = '/') ⇒ Object
105
106
107
108
|
# File 'lib/webdav.rb', line 105
def options(path = '/')
response = request(:options, path)
handle_response(response)
end
|
#patch(path, body:, content_type: 'application/xml') ⇒ Object
95
96
97
98
|
# File 'lib/webdav.rb', line 95
def patch(path, body:, content_type: 'application/xml')
response = request(:patch, path, body: body, headers: {'Content-Type' => content_type})
handle_response(response)
end
|
#post(path, body:, content_type: 'application/xml') ⇒ Object
85
86
87
88
|
# File 'lib/webdav.rb', line 85
def post(path, body:, content_type: 'application/xml')
response = request(:post, path, body: body, headers: {'Content-Type' => content_type})
handle_response(response)
end
|
#propfind(path = '/', body: nil, depth: '1') ⇒ Object
18
19
20
21
|
# File 'lib/webdav.rb', line 18
def propfind(path = '/', body: nil, depth: '1')
response = request(:propfind, path, body: body, headers: {'Depth' => depth})
handle_response(response)
end
|
#proppatch(path, body:) ⇒ Object
23
24
25
26
|
# File 'lib/webdav.rb', line 23
def proppatch(path, body:)
response = request(:proppatch, path, body: body)
handle_response(response)
end
|
#put(path, body:, content_type: 'application/octet-stream') ⇒ Object
90
91
92
93
|
# File 'lib/webdav.rb', line 90
def put(path, body:, content_type: 'application/octet-stream')
response = request(:put, path, body: body, headers: {'Content-Type' => content_type})
handle_response(response)
end
|
#report(path, body:, depth: '1') ⇒ Object
30
31
32
33
|
# File 'lib/webdav.rb', line 30
def report(path, body:, depth: '1')
response = request(:report, path, body: body, headers: {'Depth' => depth})
handle_response(response)
end
|
#trace(path) ⇒ Object
110
111
112
113
|
# File 'lib/webdav.rb', line 110
def trace(path)
response = request(:trace, path)
handle_response(response)
end
|
#unlock(path, token:) ⇒ Object
68
69
70
71
|
# File 'lib/webdav.rb', line 68
def unlock(path, token:)
response = request(:unlock, path, headers: {'Lock-Token' => "<#{token}>"})
handle_response(response)
end
|