MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / run

Method run

ij/src/main/java/ij/plugin/ProxySettings.java:18–55  ·  view source on GitHub ↗
(String arg)

Source from the content-addressed store, hash-verified

16 private int proxyport = (int)Prefs.get("proxy.port", 8080);
17
18 public void run(String arg) {
19 if (IJ.getApplet()!=null) return;
20 String host = System.getProperty("http.proxyHost");
21 if (host!=null) proxyhost = host;
22 String port = System.getProperty("http.proxyPort");
23 if (port!=null) {
24 double portNumber = Tools.parseDouble(port);
25 if (!Double.isNaN(portNumber))
26 proxyport = (int)portNumber;
27 }
28 if (!showDialog()) return;
29 if (!proxyhost.equals(""))
30 props.put("proxySet", "true");
31 else
32 props.put("proxySet", "false");
33 props.put("http.proxyHost", proxyhost);
34 props.put("http.proxyPort", ""+proxyport);
35 Prefs.set("proxy.server", proxyhost);
36 Prefs.set("proxy.port", proxyport);
37 String httpsHost = System.getProperty("https.proxyHost");
38 if (httpsHost == null) {
39 httpsHost = proxyhost;
40 }
41 int httpsPort = proxyport;
42 String httpsSystemPort = System.getProperty("https.proxyPort");
43 if (httpsSystemPort != null) {
44 double portNumber = Tools.parseDouble(httpsSystemPort);
45 if (!Double.isNaN(portNumber))
46 httpsPort = (int)portNumber;
47 }
48 props.put("https.proxyHost", httpsHost);
49 props.put("https.proxyPort", ""+httpsPort);
50 try {
51 System.setProperty("java.net.useSystemProxies", Prefs.useSystemProxies?"true":"false");
52 } catch(Exception e) {}
53 if (IJ.debugMode)
54 logProperties();
55 }
56
57 public void logProperties() {
58 IJ.log("proxy set: "+ System.getProperty("proxySet"));

Callers

nothing calls this directly

Calls 9

getAppletMethod · 0.95
parseDoubleMethod · 0.95
showDialogMethod · 0.95
setMethod · 0.95
logPropertiesMethod · 0.95
getPropertyMethod · 0.45
equalsMethod · 0.45
putMethod · 0.45
setPropertyMethod · 0.45

Tested by

no test coverage detected