I'm a bit surprised almost all replies propose an upload through CMIS here. (Only @jpotts shortly mentions the possibility to use the REST API.)
Isn't Alfresco promoting the public REST API as primary integration point?
For reference: Alfresco's REST API which could also be used to perform the upload of your document:
https://api-explorer.alfresco.com/api-explorer/#/nodes
I suspect the replies propose using CMIS because it is easier in this case. You are already in Java. OpenCMIS gives you a nice library to work with Java objects. Why go to the trouble of using the REST API? Plus, the OP wants to create documents, which is right in the CMIS wheelhouse.
Alfresco is promoting the use of the REST API primarily from remote, non-Java clients, such as a JavaScript front-end.
Either way you choose it doesn't matter--the nice thing is that developer's have options. Use what comes natural for you and the project.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.