eXist Command: put
Puts a resources to an eXist serverSynopsis
put [exist options] [file or value ...]Description
Puts resources to an eXist server.Resources are specified by the relative or absolute path.
Resources may be specified by filename or by value. If the resource argument is an atomic value then it is assumed to be a file or port name, otherwise it is taken literally as the value of the resource.
Exist Options
The put command accepts all eXist Common Options-uri uri | Specifies the uri to store the resource |
-baseuri baseuri | Specifies the base uri (collection) to store the resources |
-t,-text | Outputs the result as text. Equivalent to -contentType text/plain |
-b,-binary | Outputs the result as binary. Equivilent to -contentType application/octet-stream |
-x,-xml | Outputs the result as xml. Equivalent to -contentType text/xml |
One and only one of -uri or -baseuri must be specified.
If -uri is specified and no additional arguments are present then standard input is used as the resource content.
If -baseuri is specifed then the resource content must come from a named file, and the basename of that file is used as the name of the resource within the collection (base uri).
Example
Assuming the prefix "e" is imported as the exist module, put the xml value <elem/> into the resource test.xmle:put -uri test.xml <[ <elem/> ]> e:get test.xml
Result
<elem/>
Puts the text "Hello World" into the resource "hello.txt"
echo "Hello World" | e:put -uri test.txt e:get test.txt
Result
Hello World
Puts all .xml files in the current directory into the collection /db/test
e:put -baseuri /db/test *.xml
Implementation
put is implemented using the REST protocol using the PUT method
See http://exist.sourceforge.net/devguide_rest.html
eXist Extension Module