Lines 47-61
Link Here
|
47 |
import java.io.OutputStreamWriter; |
47 |
import java.io.OutputStreamWriter; |
48 |
import java.nio.charset.Charset; |
48 |
import java.nio.charset.Charset; |
49 |
import java.util.List; |
49 |
import java.util.List; |
|
|
50 |
import java.util.concurrent.CancellationException; |
50 |
import java.util.logging.Level; |
51 |
import java.util.logging.Level; |
51 |
import java.util.regex.Matcher; |
52 |
import java.util.regex.Matcher; |
52 |
import java.util.regex.Pattern; |
53 |
import java.util.regex.Pattern; |
|
|
54 |
import org.netbeans.modules.nativeexecution.api.ExecutionEnvironment; |
55 |
import org.netbeans.modules.nativeexecution.api.ExecutionEnvironmentFactory; |
53 |
import org.netbeans.modules.nativeexecution.api.util.ShellValidationSupport.ShellValidationStatus; |
56 |
import org.netbeans.modules.nativeexecution.api.util.ShellValidationSupport.ShellValidationStatus; |
54 |
import org.netbeans.modules.nativeexecution.support.Logger; |
57 |
import org.netbeans.modules.nativeexecution.support.Logger; |
55 |
import org.netbeans.modules.nativeexecution.api.util.Shell.ShellType; |
58 |
import org.netbeans.modules.nativeexecution.api.util.Shell.ShellType; |
56 |
import org.netbeans.modules.nativeexecution.support.windows.PathConverter; |
59 |
import org.netbeans.modules.nativeexecution.support.windows.PathConverter; |
57 |
import org.netbeans.modules.nativeexecution.support.windows.PathConverter.PathType; |
60 |
import org.netbeans.modules.nativeexecution.support.windows.PathConverter.PathType; |
58 |
import org.netbeans.modules.nativeexecution.support.windows.SimpleConverter; |
61 |
import org.netbeans.modules.nativeexecution.support.windows.SimpleConverter; |
|
|
62 |
import org.openide.util.Exceptions; |
59 |
import org.openide.util.Utilities; |
63 |
import org.openide.util.Utilities; |
60 |
|
64 |
|
61 |
/** |
65 |
/** |
Lines 96-109
Link Here
|
96 |
init(null); |
100 |
init(null); |
97 |
} |
101 |
} |
98 |
|
102 |
|
99 |
public void init(String searchDir) { |
103 |
public synchronized void init(String searchDir) { |
100 |
if (!isWindows) { |
104 |
if (!isWindows) { |
101 |
return; |
105 |
return; |
102 |
} |
106 |
} |
103 |
|
107 |
|
104 |
pathConverter = new SimpleConverter(); |
108 |
pathConverter = new SimpleConverter(); |
|
|
109 |
|
110 |
final ExecutionEnvironment env = ExecutionEnvironmentFactory.getLocal(); |
111 |
boolean resetHIU = HostInfoUtils.isHostInfoAvailable(env) ? true : false; |
112 |
|
105 |
activeShell = findShell(searchDir); |
113 |
activeShell = findShell(searchDir); |
106 |
initCharset(); |
114 |
initCharset(); |
|
|
115 |
|
116 |
if (resetHIU) { |
117 |
HostInfoUtils.resetHostsData(env); |
118 |
try { |
119 |
HostInfoUtils.getHostInfo(env); |
120 |
} catch (IOException ex) { |
121 |
Exceptions.printStackTrace(ex); |
122 |
} catch (CancellationException ex) { |
123 |
Exceptions.printStackTrace(ex); |
124 |
} |
125 |
} |
107 |
} |
126 |
} |
108 |
|
127 |
|
109 |
private Shell findShell(String searchDir) { |
128 |
private Shell findShell(String searchDir) { |