example how to post files to the api using Java.
Example taken from apache, and altered to our needs.