Skip to content

Commit a30a2b5

Browse files
author
jantje
committed
#722 more descritive message
1 parent ed7df57 commit a30a2b5

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

io.sloeber.core/src/io/sloeber/core/Activator.java

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ protected IStatus run(IProgressMonitor monitor) {
213213
*
214214
* @return true is installation can be done else false
215215
*/
216-
@SuppressWarnings("boxing")
217216
private boolean DownloadFolderConditionsOK() {
218217
IPath installPath = ConfigurationPreferences.getInstallationPath();
219218
installPath.toFile().mkdirs();
@@ -223,12 +222,19 @@ private boolean DownloadFolderConditionsOK() {
223222
windowsPathToLong = installPath.toString().length() > 40;
224223
}
225224
if (cantWrite || windowsPathToLong) {
226-
String errorMessage = cantWrite ? "The plugin Needs write access to " + installPath.toString()
227-
: new String();
228-
errorMessage += ((windowsPathToLong && cantWrite) ? '\n' : new String());
229-
errorMessage += (windowsPathToLong ? "The path " + installPath.toString() + " is to long"
230-
: new String());
231-
225+
String errorMessage = new String();
226+
if (cantWrite) {
227+
errorMessage = "The plugin Needs write access to " + installPath.toString();
228+
}
229+
if (windowsPathToLong) {
230+
if (cantWrite) {
231+
errorMessage += '\n';
232+
}
233+
errorMessage += "Due to issues with long pathnames on Windows, the plugin installation path must less than 40 characters. \n";
234+
errorMessage += "Your current path: " + installPath.toString();
235+
errorMessage += " is too long and the plugin will no longer function correctly for all packages.";
236+
errorMessage += "Please visit issue #705 for details. https://github.com/Sloeber/arduino-eclipse-plugin/issues/705";
237+
}
232238
Common.log(new Status(IStatus.ERROR, PLUGIN_ID, errorMessage));
233239
return false;
234240
}
@@ -407,7 +413,6 @@ static boolean isPatron() {
407413
try {
408414
urlConnect.getContent();
409415
} catch (IOException e) {
410-
// TODO Auto-generated catch block
411416
e.printStackTrace();
412417
}
413418
int length = urlConnect.getContentLength();

0 commit comments

Comments
 (0)