class DeployActivitySpecs {

    protected static String deployActivitySpec(String hostname, String activitySpecName) throws Exception {
        String payload = new String(Files.readAllBytes(Paths.get(ACTIVITY_FILE_LOCATION + activitySpecName)));
        try {
            HttpClient client = HttpClientBuilder.create().build();

            String url = UriBuilder.fromUri(hostname).path(ACTIVITY_SPEC_URI).build().toString();
            HttpPost post = new HttpPost(url);

            StringEntity input = new StringEntity(payload);
            input.setContentType(CONTENT_TYPE_JSON);
            post.setEntity(input);

            HttpResponse response = client.execute(post);
            StatusLine statusLine = response.getStatusLine();

            if (statusLine != null) {
                if (statusLine.getStatusCode() != 200) {
                    return (statusLine.toString());
                } else {
                    return null;
                }
            } else {
                return ("Empty response from the remote endpoint");
            }

        } catch (Exception e) {
            return e.getMessage();
        }

    }

}