[JBoss JIRA] (JBIDE-23862) Server adapter: if "oc" in preferences is set to path with a " " syncing fails
by Dmitrii Bocharov (JIRA)
[ https://issues.jboss.org/browse/JBIDE-23862?page=com.atlassian.jira.plugi... ]
Dmitrii Bocharov edited comment on JBIDE-23862 at 5/12/17 9:04 AM:
-------------------------------------------------------------------
I said firstly that it wouldn't work because even if we add quotes, we split the command string with spaces after: https://github.com/openshift/openshift-restclient-java/pull/255/files#dif.... So i'm really surprised now that when we run
{code:java}
ProcessBuilder builder = new ProcessBuilder(args);
builder.start();
{code}
and pass the following array inside ProcessBuilder:
{noformat}
["C:\name, with, spaces\oc.exe", rsync, --token=ToKeN server=https://10.1.2.2:8443, --insecure-skip-tls-verify=true, --exclude='.git', jboss-eap70-openshift-1-zn39w:/opt/eap/standalone/deployments/, -n, myproject, C:\Users\dbocharo\dev\runtime-New_configuration\.metadata\.plugins\org.jboss.ide.eclipse.as.core\myproject@jboss-eap70-openshift\deploy\]
{noformat}
everything finishes without errors.
It means that
{noformat}
"C:\name, with, spaces\oc.exe"
{noformat}
is somehow transformed correctly into
{noformat}
"C:\name with spaces\oc.exe"
{noformat}
and not
{noformat}
"C:\namewithspaces\oc.exe"
{noformat}
was (Author: dbocharov):
I said firstly that it wouldn't work because even if we add quotes, we split the command string with spaces after: https://github.com/openshift/openshift-restclient-java/pull/255/files#dif.... So i'm really surprised now that when we run
{code:java}
ProcessBuilder builder = new ProcessBuilder(args);
builder.start();
{code}
and pass the following array inside ProcessBuilder:
{noformat}
["C:\name, with, spaces\oc.exe", rsync, --token=ToKeN server=https://10.1.2.2:8443, --insecure-skip-tls-verify=true, --exclude='.git', jboss-eap70-openshift-1-zn39w:/opt/eap/standalone/deployments/, -n, myproject, C:\Users\dbocharo\dev\runtime-New_configuration\.metadata\.plugins\org.jboss.ide.eclipse.as.core\myproject@jboss-eap70-openshift\deploy\]
{noformat}
everything finishes without errors.
> Server adapter: if "oc" in preferences is set to path with a " " syncing fails
> ------------------------------------------------------------------------------
>
> Key: JBIDE-23862
> URL: https://issues.jboss.org/browse/JBIDE-23862
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: openshift
> Affects Versions: 4.4.3.Final
> Reporter: Andre Dietisheim
> Assignee: Andre Dietisheim
> Fix For: 4.5.0.AM1
>
> Attachments: ProcessMain.java
>
>
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 11 months
[JBoss JIRA] (JBIDE-23862) Server adapter: if "oc" in preferences is set to path with a " " syncing fails
by Dmitrii Bocharov (JIRA)
[ https://issues.jboss.org/browse/JBIDE-23862?page=com.atlassian.jira.plugi... ]
Dmitrii Bocharov commented on JBIDE-23862:
------------------------------------------
I said firstly that it wouldn't work because even if we add quotes, we split the command string with spaces after: https://github.com/openshift/openshift-restclient-java/pull/255/files#dif.... So i'm really surprised now that when we run
{code:java}
ProcessBuilder builder = new ProcessBuilder(args);
builder.start();
{code}
and pass the following array inside ProcessBuilder:
{noformat}
["C:\name, with, spaces\oc.exe", rsync, --token=ToKeN server=https://10.1.2.2:8443, --insecure-skip-tls-verify=true, --exclude='.git', jboss-eap70-openshift-1-zn39w:/opt/eap/standalone/deployments/, -n, myproject, C:\Users\dbocharo\dev\runtime-New_configuration\.metadata\.plugins\org.jboss.ide.eclipse.as.core\myproject@jboss-eap70-openshift\deploy\]
{noformat}
everything finishes without errors.
> Server adapter: if "oc" in preferences is set to path with a " " syncing fails
> ------------------------------------------------------------------------------
>
> Key: JBIDE-23862
> URL: https://issues.jboss.org/browse/JBIDE-23862
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: openshift
> Affects Versions: 4.4.3.Final
> Reporter: Andre Dietisheim
> Assignee: Andre Dietisheim
> Fix For: 4.5.0.AM1
>
> Attachments: ProcessMain.java
>
>
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 11 months
[JBoss JIRA] (JBIDE-23862) Server adapter: if "oc" in preferences is set to path with a " " syncing fails
by Dmitrii Bocharov (JIRA)
[ https://issues.jboss.org/browse/JBIDE-23862?page=com.atlassian.jira.plugi... ]
Dmitrii Bocharov edited comment on JBIDE-23862 at 5/12/17 8:55 AM:
-------------------------------------------------------------------
[~jeffmaury][~aurelien.pupier] i confirm, that it works on Windows now. It does, because of the [~adietish]'s fix: https://github.com/openshift/openshift-restclient-java/pull/255/files. What it does is adds double quotes in case a space is found in the path to the oc binary. But we should follow another strategy for Unix-like OSs, inclusing MacOS, Fedora, etc. That's why it doesn't work for them. I'll work on it
was (Author: dbocharov):
[~jeffmaury][~aurelien.pupier] confirm, that it works on Windows now. I does, because of the [~adietish]'s fix: https://github.com/openshift/openshift-restclient-java/pull/255/files. What it does is adds double quotes in case a space is found in the path to the oc binary. But we should follow another strategy for Unix-like OSs, inclusing MacOS, Fedora, etc. That's why it doesn't work for them. I'll work on it
> Server adapter: if "oc" in preferences is set to path with a " " syncing fails
> ------------------------------------------------------------------------------
>
> Key: JBIDE-23862
> URL: https://issues.jboss.org/browse/JBIDE-23862
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: openshift
> Affects Versions: 4.4.3.Final
> Reporter: Andre Dietisheim
> Assignee: Andre Dietisheim
> Fix For: 4.5.0.AM1
>
> Attachments: ProcessMain.java
>
>
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 11 months