Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 429096 | Differences between
and this patch

Collapse All | Expand All

(-)a/bundles/org.eclipse.orion.server.cf/src/org/eclipse/orion/server/cf/commands/CreateApplicationCommand.java (-1 / +5 lines)
Lines 38-43 Link Here
38
	private String appCommand;
38
	private String appCommand;
39
	private int appInstances;
39
	private int appInstances;
40
	private int appMemory;
40
	private int appMemory;
41
	private String buildPack;
41
42
42
	private boolean force;
43
	private boolean force;
43
44
Lines 73-79 Link Here
73
			createAppRequst.put(CFProtocolConstants.V2_KEY_SPACE_GUID, target.getSpace().getCFJSON().getJSONObject(CFProtocolConstants.V2_KEY_METADATA).getString(CFProtocolConstants.V2_KEY_GUID));
74
			createAppRequst.put(CFProtocolConstants.V2_KEY_SPACE_GUID, target.getSpace().getCFJSON().getJSONObject(CFProtocolConstants.V2_KEY_METADATA).getString(CFProtocolConstants.V2_KEY_GUID));
74
			createAppRequst.put(CFProtocolConstants.V2_KEY_NAME, appName);
75
			createAppRequst.put(CFProtocolConstants.V2_KEY_NAME, appName);
75
			createAppRequst.put(CFProtocolConstants.V2_KEY_INSTANCES, appInstances);
76
			createAppRequst.put(CFProtocolConstants.V2_KEY_INSTANCES, appInstances);
76
			createAppRequst.put(CFProtocolConstants.V2_KEY_BUILDPACK, JSONObject.NULL);
77
			createAppRequst.put(CFProtocolConstants.V2_KEY_BUILDPACK, buildPack != null ? buildPack : JSONObject.NULL);
77
			createAppRequst.put(CFProtocolConstants.V2_KEY_COMMAND, appCommand);
78
			createAppRequst.put(CFProtocolConstants.V2_KEY_COMMAND, appCommand);
78
			createAppRequst.put(CFProtocolConstants.V2_KEY_MEMORY, appMemory);
79
			createAppRequst.put(CFProtocolConstants.V2_KEY_MEMORY, appMemory);
79
			createAppRequst.put(CFProtocolConstants.V2_KEY_STACK_GUID, JSONObject.NULL);
80
			createAppRequst.put(CFProtocolConstants.V2_KEY_STACK_GUID, JSONObject.NULL);
Lines 113-118 Link Here
113
			}
114
			}
114
			appMemory = ManifestUtils.getMemoryLimit(mem); /* optional */
115
			appMemory = ManifestUtils.getMemoryLimit(mem); /* optional */
115
116
117
			//buildpack
118
			buildPack = appJSON.optString(CFProtocolConstants.V2_KEY_BUILDPACK, null);
119
116
			return Status.OK_STATUS;
120
			return Status.OK_STATUS;
117
121
118
		} catch (ParseException e) {
122
		} catch (ParseException e) {
(-)a/bundles/org.eclipse.orion.server.cf/src/org/eclipse/orion/server/cf/manifest/ManifestUtils.java (-5 / +18 lines)
Lines 50-61 Link Here
50
	 * Parses <A>:<B> from the input line.
50
	 * Parses <A>:<B> from the input line.
51
	 */
51
	 */
52
	static String[] splitLabel(String input) {
52
	static String[] splitLabel(String input) {
53
		String[] sLabel = input.split(":"); //$NON-NLS-1$
53
		int idx = input.indexOf(":");
54
		if (sLabel[0].startsWith("- ")) //$NON-NLS-1$
54
		String head = null;
55
			sLabel[0] = sLabel[0].substring(2);
55
		String tail = null;
56
		if (idx != -1) {
57
			head = input.substring(0, idx);
58
			tail = input.substring(idx + 1);
59
			tail = tail.trim();
60
		} else {
61
			head = input;
62
		}
56
63
57
		if (sLabel.length > 1)
64
		if (head.startsWith("- ")) //$NON-NLS-1$
58
			sLabel[1] = sLabel[1].trim();
65
			head = head.substring(2);
66
67
		String[] sLabel;
68
		if (tail != null && !tail.isEmpty())
69
			sLabel = new String[] {head, tail};
70
		else
71
			sLabel = new String[] {head};
59
72
60
		return sLabel;
73
		return sLabel;
61
	}
74
	}

Return to bug 429096