File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 34
34
import javax .swing .event .HyperlinkEvent ;
35
35
import javax .swing .event .HyperlinkListener ;
36
36
import java .net .URL ;
37
+ import java .net .URI ;
38
+ import java .awt .Desktop ;
39
+ import java .io .IOException ;
40
+ import java .net .URISyntaxException ;
37
41
38
42
public class UpdatableBoardsLibsFakeURLsHandler implements HyperlinkListener {
39
43
@@ -71,6 +75,18 @@ public void openBoardLibManager(URL url) {
71
75
return ;
72
76
}
73
77
78
+ if (Desktop .isDesktopSupported ())
79
+ {
80
+ try {
81
+ Desktop .getDesktop ().browse (url .toURI ());
82
+ return ;
83
+ } catch (IOException e ) {
84
+ throw new IllegalArgumentException (url .getHost () + " is invalid" );
85
+ } catch (URISyntaxException e ) {
86
+ throw new IllegalArgumentException (url .getHost () + " is invalid" );
87
+ }
88
+ }
89
+
74
90
throw new IllegalArgumentException (url .getHost () + " is invalid" );
75
91
76
92
}
You can’t perform that action at this time.
0 commit comments