I'd also be interested in this (using either Java or JavaScript), in order to automate the configuration of Share Sites.
We would like to be able to set up a server and site(s) with a set of predefined folders, permissions and rules created programatically. As development proceeds, we can then reproducibly set up servers for experimentation, and then eventually be able to reproduce those setups into test and production.
Does anybody do this already? Or does everyone set up servers by hand, via a set of manual instructions?