# NOT RUN {
# establish a connection to the alfresco content repository
my_session <- alf_session("alfresco.my-org.com", "admin", "admin")
# get details of document node
my_document <- alf_node(my_session, relative_path = "testFolder/testdoc.txt")
# output the name of the document
print(my_document$name)
#[1] "testdoc.txt"
# output the details of documents content
print(my_document$content$mime_type)
#[1] "text/plain"
print(my_document$content$mime_type_name)
#[1] "Plain Text"
print(my_document$content$size)
#[1] 19
print(my_document$content$encoding)
#[1] "ISO-8859-1"
# read document content
my_content_file <- file(my_document$content$as.file(), "r")
my_content <- readLines(my_content_file)
close(my_content_file)
# upload new content
my_document <- my_document$content$update("resources/testuploaddoc.txt")
# }
Run the code above in your browser using DataLab