@@ -196,6 +196,18 @@ public static File getLocalFileName(String url) {
196
196
return packagePath .toFile ();
197
197
}
198
198
199
+ /**
200
+ * convert a local file name to a baeyens it alternative download name There
201
+ * is no check wether the file exists only a conversion
202
+ *
203
+ * @param url
204
+ * url of the file we want a local
205
+ * @return the file that represents the file on Baeyens.it
206
+ */
207
+ private static String getBaeyensItAlternativeDownload (String localFileName ) {
208
+ return "http://eclipse.baeyens.it/download/" + localFileName ; //$NON-NLS-1$
209
+ }
210
+
199
211
/**
200
212
* This method takes a json boards file url and downloads it and parses it
201
213
* for usage in the boards manager
@@ -213,10 +225,15 @@ static private void loadJson(String url, boolean forceDownload) {
213
225
}
214
226
if (!jsonFile .exists () || forceDownload ) {
215
227
jsonFile .getParentFile ().mkdirs ();
228
+ String alternativeDownloadurl = getBaeyensItAlternativeDownload (jsonFile .getName ());
216
229
try {
217
- myCopy (new URL (url .trim ()), jsonFile );
218
- } catch (IOException e ) {
219
- Common .log (new Status (IStatus .ERROR , Activator .getId (), "Unable to download " + url , e )); //$NON-NLS-1$
230
+ myCopy (new URL (alternativeDownloadurl .trim ()), jsonFile );
231
+ } catch (IOException e0 ) {
232
+ try {
233
+ myCopy (new URL (url .trim ()), jsonFile );
234
+ } catch (IOException e ) {
235
+ Common .log (new Status (IStatus .ERROR , Activator .getId (), "Unable to download " + url , e )); //$NON-NLS-1$
236
+ }
220
237
}
221
238
}
222
239
if (jsonFile .exists ()) {
0 commit comments