code: public String uploadWar(String warName, File warFile) throws Exception {
  
      HttpPost post = new HttpPost("http://"+host+":"+port+"/management/add-content");
  
      try {
        MultipartEntity entity = new MultipartEntity();
        entity.addPart("filename", new StringBody(warName));
        entity.addPart("attachment", new FileBody(warFile, ContentType.APPLICATION_OCTET_STREAM.getMimeType()));
        post.setEntity(entity);
  
        HttpResponse response = client.execute(post);
        if(response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
          String respStr = EntityUtils.toString(response.getEntity());
          Map<String, Object> respObj = new Gson().fromJson(respStr, new TypeToken<Map<String, Object>>(){}.getType());
          if("success".equals(respObj.get("outcome"))) {
            Object resultObj = respObj.get("result");
            if(resultObj instanceof Map) {
              Map<String, Object> resultMap = (Map<String, Object>) resultObj;
              return (String) resultMap.get("BYTES_VALUE");
            }
          } else {
            String failureMessage = (String) respObj.get("failure-description");
            if (failureMessage == null) {
              failureMessage = "Failed to process request.";
            }
            logger.warn(failureMessage);
            throw new Exception("Received " + failureMessage + " response from management api.");
          }
        }
      } finally {
        post.releaseConnection();
      }
      return null;
    }
docs: /*
  curl -v --digest -u "admin" -F "file=@git/cadmium/test.cadmium.localhost.war;filename=test.cadmium.localhost.war" http://localhost:9990/management/add-content
  result: {"outcome" : "success", "result" : { "BYTES_VALUE" : "SbejgggTNOuHdke5k6EeKdB8Zfo=" }}