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

26 lines
609 B
Ruby
Executable File

#!/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}"
# dir = "files_from_git"
# binding.break
# result = webdav.directory.create(dir)
# puts result
# result = webdav.directory.put("lib.rb", File.join(dir, "lib.rb"))
# puts result
dir2 = "/remote.php/dav/files/dvarrui/"
file = "Nextcloud%20Manual.pdf"
data = webdav.directory.find file
puts data.contents