Skip to content

Instantly share code, notes, and snippets.

@ricn ricn/cmis.rb
Last active Dec 21, 2015

What would you like to do?
require 'cmis'
require 'rika'
atom_url = "http://localhost:8080/alfresco/cmisatom"
user = "admin"
password = "admin"
session = CMIS::create_session(atom_url, user, password)
root = session.root_folder
image_folder = root.create_cmis_folder("Images")
local_folder = "/Users/ricn/temp/images"
files_to_upload = Dir["#{local_folder}/*"]
files_to_upload.each do |file|
id = image_folder.create_cmis_document(File.basename(file), file)
doc = session.get_object(id)
puts "#{} uploaded."
image_folder = session.get_object_by_path("/Images")
image_folder.get_children.each do |child|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.