共有フォルダーにファイルをアップロードしようとしています...これは私のコードです。
// using httpclient-4.5
Path filePath = Paths.get("C:/afile.txt");
String ticket = getTicket(); // get a ticket via /alfresco/service/api/login...
CloseableHttpClient client = HttpClients.createDefault();
HttpPost post = new HttpPost("http://localhost:8080/alfresco/service/api/upload?alf_ticket=" + ticket);
MultipartEntityBuilder entity = MultipartEntityBuilder.create();
StringBody descriptionBody = new StringBody("a test", ContentType.TEXT_PLAIN);
StringBody siteId = new StringBody("company_home", ContentType.TEXT_PLAIN); // how can upload the file
StringBody containerid = new StringBody("/Shared", ContentType.TEXT_PLAIN); // in the shared folder??
entity.addBinaryBody("filedata", filePath.toFile());
entity.addPart("siteid", siteId);
entity.addPart("containerid", containerid);
post.setEntity(entity.build());
CloseableHttpResponse postResponse = client.execute(post);
// ...
誰でも私を助けることができますか?ありがとう。