File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 3434import javax .swing .event .HyperlinkEvent ;
3535import javax .swing .event .HyperlinkListener ;
3636import java .net .URL ;
37+ import java .net .URI ;
38+ import java .awt .Desktop ;
39+ import java .io .IOException ;
40+ import java .net .URISyntaxException ;
3741
3842public class UpdatableBoardsLibsFakeURLsHandler implements HyperlinkListener {
3943
@@ -71,6 +75,18 @@ public void openBoardLibManager(URL url) {
7175 return ;
7276 }
7377
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+
7490 throw new IllegalArgumentException (url .getHost () + " is invalid" );
7591
7692 }
You can’t perform that action at this time.
0 commit comments