From 433f49e475cd775520a73dddd4149191471b261a Mon Sep 17 00:00:00 2001 From: Andre Dietisheim Date: Mon, 6 Feb 2017 22:33:21 +0100 Subject: [PATCH] [JBIDE-23862] ensure path to oc is quoted if it contains " " --- .../resources/AbstractOpenShiftBinaryCapability.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/com/openshift/internal/restclient/capability/resources/AbstractOpenShiftBinaryCapability.java b/src/main/java/com/openshift/internal/restclient/capability/resources/AbstractOpenShiftBinaryCapability.java index 09ae1630..f5632dec 100644 --- a/src/main/java/com/openshift/internal/restclient/capability/resources/AbstractOpenShiftBinaryCapability.java +++ b/src/main/java/com/openshift/internal/restclient/capability/resources/AbstractOpenShiftBinaryCapability.java @@ -217,6 +217,17 @@ protected String getOpenShiftBinaryLocation() { String.format("The OpenShift 'oc' binary location was not specified. Set the property %s", OPENSHIFT_BINARY_LOCATION)); } + + location = addQuotesIfRequired(location); return location; } + + private String addQuotesIfRequired(String location) { + if (!StringUtils.isEmpty(location) + && location.contains(" ")) { + location = "\"" + location + "\""; + } + return location; + } + }