Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2018-08-23 12:09:12 -0400
committerJeff Johnston2018-08-23 14:03:37 -0400
commit12f5951ad81273bac3678f68d19038c161db7966 (patch)
treecb8a99077e94dea4558a3b9509e3aec776d85fc2
parent429165f0a8ed2a18cfe504074e96a5ee19974da1 (diff)
downloadorg.eclipse.linuxtools-12f5951ad81273bac3678f68d19038c161db7966.tar.gz
org.eclipse.linuxtools-12f5951ad81273bac3678f68d19038c161db7966.tar.xz
org.eclipse.linuxtools-12f5951ad81273bac3678f68d19038c161db7966.zip
Bug 538217 - InvalidPathException in VagrantConnection
- findVagrantPath() method uses the system path to find possible locations of vagrant.exe - sometimes, the path which contains spaces or other characters comes back quoted - must remove the quotes before creating a new path Change-Id: I44c5a45d6d064c7e0d085e4ec37ddefffc6fefe1 Reviewed-on: https://git.eclipse.org/r/127948 Tested-by: CI Bot Reviewed-by: Jeff Johnston <jjohnstn@redhat.com>
-rw-r--r--vagrant/org.eclipse.linuxtools.vagrant.core/src/org/eclipse/linuxtools/internal/vagrant/core/VagrantConnection.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/vagrant/org.eclipse.linuxtools.vagrant.core/src/org/eclipse/linuxtools/internal/vagrant/core/VagrantConnection.java b/vagrant/org.eclipse.linuxtools.vagrant.core/src/org/eclipse/linuxtools/internal/vagrant/core/VagrantConnection.java
index 214514febd..436e5c87c5 100644
--- a/vagrant/org.eclipse.linuxtools.vagrant.core/src/org/eclipse/linuxtools/internal/vagrant/core/VagrantConnection.java
+++ b/vagrant/org.eclipse.linuxtools.vagrant.core/src/org/eclipse/linuxtools/internal/vagrant/core/VagrantConnection.java
@@ -506,6 +506,12 @@ public class VagrantConnection implements IVagrantConnection, Closeable {
final String envPath = System.getenv("PATH"); //$NON-NLS-1$
if (envPath != null) {
for (String dir : envPath.split(File.pathSeparator)) {
+ // On Windows, we might get back a String with quotes so we must
+ // remove them (Bug 538217)
+ if ('"' == dir.charAt(0) // $NON-NLS-1$
+ && '"' == dir.charAt(dir.length() - 1)) { // $NON-NLS-1$
+ dir = dir.substring(1, dir.length() - 1);
+ }
Path vgPath = Paths.get(dir, vgName);
if (vgPath.toFile().exists()) {
return vgPath.toString();

Back to the top