|
6 | 6 | import java.nio.file.Paths;
|
7 | 7 |
|
8 | 8 | import org.eclipse.core.runtime.IPath;
|
| 9 | +import org.eclipse.core.runtime.IStatus; |
9 | 10 | import org.eclipse.core.runtime.Path;
|
10 | 11 | import org.eclipse.core.runtime.Platform;
|
| 12 | +import org.eclipse.core.runtime.Status; |
11 | 13 | import org.eclipse.core.runtime.preferences.ConfigurationScope;
|
12 | 14 | import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
13 | 15 | import org.osgi.service.prefs.BackingStoreException;
|
@@ -45,16 +47,17 @@ public static Path getInstallationPath() {
|
45 | 47 | }
|
46 | 48 | String storedValue = getGlobalString(Const.KEY_MANAGER_DOWNLOAD_LOCATION, Const.EMPTY_STRING);
|
47 | 49 | if (storedValue.isEmpty()) {
|
48 |
| - URI uri; |
49 | 50 | try {
|
50 |
| - uri = Platform.getInstallLocation().getURL().toURI(); |
| 51 | + URI uri = Platform.getInstallLocation().getURL().toURI(); |
51 | 52 | String defaulDownloadLocation = Paths.get(uri).resolve("arduinoPlugin").toString(); //$NON-NLS-1$
|
52 | 53 | return new Path(defaulDownloadLocation);
|
53 | 54 | } catch (URISyntaxException e) {
|
54 | 55 | // this should not happen
|
55 |
| - e.printStackTrace(); |
| 56 | + // but it seems a space in the path makes it happen |
| 57 | + Common.log(new Status(IStatus.ERROR, Const.CORE_PLUGIN_ID, |
| 58 | + "Eclipse fails to provide its own installation folder :-(. \nThis is know to happen when you have a space in your eclipse installation path", //$NON-NLS-1$ |
| 59 | + e)); |
56 | 60 | }
|
57 |
| - |
58 | 61 | }
|
59 | 62 | return new Path(storedValue);
|
60 | 63 | }
|
|
0 commit comments