@Override public document createFile(URI uri, String name, String desc) throws IOException { HttpPost httpPost = new HttpPost(uri); httpPost.addHeader("Authorization", "OAuth2 " + tokenClient.getAccessToken()); httpPost.addHeader("Content-Type", "application/vnd.huddle.data+xml"); // set the body to post StringEntity entity = new StringEntity( "<document title=" + "\"" + name + "\"" + " description=" + "\"" + desc + "\"" + "/>"); httpPost.setEntity(entity); HttpResponse response = httpClient.execute(httpPost); document document = xml.parseXmlDocuments(response.getEntity().getContent()); return document; }