Create Repository Work space using Plain JAVA API
One answer
Should be absolutely doable. See https://rsjazz.wordpress.com/2013/09/24/managing-workspaces-streams-and-components-using-the-plain-java-client-libraries/ for some of what you need and google this site for more hints.