if (outcome.equals(SUCCESS)) { // Upload was successful, so now add the file to the server group
JsonNode resultNode = uploadResult.get("result");
String hash = resultNode.get("BYTES_VALUE").getTextValue();
ASConnection connection = getASConnection();
Address deploymentsAddress = new Address();
deploymentsAddress.add("deployment", packageName);
Operation step1 = new Operation("add", deploymentsAddress);
// step1.addAdditionalProperty("hash", new PROPERTY_VALUE("BYTES_VALUE", hash));
List<Object> content = new ArrayList<Object>(1);
Map<String, Object> contentValues = new HashMap<String, Object>();
contentValues.put("hash", new PROPERTY_VALUE("BYTES_VALUE", hash));
content.add(contentValues);
step1.addAdditionalProperty("content", content);
step1.addAdditionalProperty("name", packageName);
Address serverGroupAddress = new Address(context.getResourceKey());
serverGroupAddress.add("deployment", packageName);
Operation step2 = new Operation("add", serverGroupAddress);
Operation step3 = new Operation("deploy", serverGroupAddress);
CompositeOperation cop = new CompositeOperation();
cop.addStep(step1);