code: public boolean canCheckWar(String warName, String url, HttpClient client) {
      HttpOptions opt = new HttpOptions(url + "/" + warName);
      try {
        HttpResponse response = client.execute(opt);
        if(response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
          Header allowHeader[] = response.getHeaders("Allow");
          for(Header allow : allowHeader) {
            List<String> values = Arrays.asList(allow.getValue().toUpperCase().split(","));
            if(values.contains("GET")) {
              return true;
            }
          }
        }
        EntityUtils.consumeQuietly(response.getEntity());
      } catch (Exception e) {
        log.warn("Failed to check if endpoint exists.", e);
      } finally {
        opt.releaseConnection();
      }
      return false;
    }
docs: Checks via an http options request that the endpoint exists to check for deployment state.
  @param warName
  @param url
  @param client
  @return