educatic-info/bin/nextcloud/06-webdav.rb

26 lines
609 B
Ruby
Raw Normal View History

2022-12-01 15:22:21 +01:00
#!/usr/bin/env ruby
require_relative "lib"
nextcloud = get_nextcloud_object()
webdav = nextcloud.webdav
ocs = nextcloud.ocs
puts "* ocs.webdav.directory: #{ocs.webdav.directory}"
webdav = nextcloud.webdav
path = webdav.directory.instance_variable_get(:@path)
puts "* webdav.directory(@path): #{path}"
2022-12-02 10:22:11 +01:00
# dir = "files_from_git"
# binding.break
# result = webdav.directory.create(dir)
# puts result
2022-12-01 16:24:01 +01:00
2022-12-02 10:22:11 +01:00
# result = webdav.directory.put("lib.rb", File.join(dir, "lib.rb"))
# puts result
2022-12-01 15:22:21 +01:00
2022-12-02 10:22:11 +01:00
dir2 = "/remote.php/dav/files/dvarrui/"
file = "Nextcloud%20Manual.pdf"
2022-12-01 16:24:01 +01:00
2022-12-02 10:22:11 +01:00
data = webdav.directory.find file
puts data.contents