Modeshape JCR Rest Client

This jcr rest client enables the scripting of publishing and unpublishing of artifacts to the ModeShape repository.

The following are the parameters for scripting:

--server        - http url, example: http://localhost:8080/modeshape-rest   (http://{host:port}//context)
--repo          - use 'dv', its the default repo configured at installation
--workspacepath - an example is '/files', its the default workspacepath patch configured at installation
--file          - the full path to the file/artifact to publish  OR 
--dir           - the directory to reference to publish all artifacts in that location
--username      - modeshape user name (i.e modeshapeUser)
--pwd           - password
--workspacename - use 'default', its the default workspace configured at installation
--unpublish     - with no parameter, will remove file(s)      

You can also run --help which will print out:
        Running the ModeShape Rest Client
        	required arguments are:
          	 	--server
          	 	--file  or  --dir
          		--workspacepath
          		--repo
        	optional arguments are:
          	 	--workspacename  (default=default)
         		  --username (default=admin")
          	 	--pwd  (default=admin")
          	 	--unpublish  with no parameter, will remove file(s)

Example execution when running the script on the machine as the server:

. ./restclient.sh  --server http://localhost:8080/modeshape-rest --repo dv --workspacepath '/files' --file $1 --username $2 --pwd $3

If you get a http 401 response code, it means the authorization credentials (username and pwd) are not correct