dragonsKnight5 commented on code in PR #6585:
URL: https://github.com/apache/netbeans/pull/6585#discussion_r1364853212


##########
ide/extbrowser/src/org/netbeans/modules/extbrowser/NbDdeBrowserImpl.java:
##########
@@ -127,6 +132,169 @@ public NbDdeBrowserImpl (ExtWebBrowser extBrowserFactory) 
{
      */
     public static native String getDefaultOpenCommand() throws 
NbBrowserException;
     
+    /**
+     * Get the default browser name using java
+     * part of the solution source 
https://stackoverflow.com/questions/62289/read-write-to-windows-registry-using-java
+     * @return 
+     */
+    private static String getDefaultWindowsBrowser()
+    {
+        try
+        {
+            Process process = Runtime.getRuntime().exec("reg query 
HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\Shell\\Associations\\URLAssociations\\https\\UserChoice
 /f ProgId /v");
+            
+            InputStream is = process.getInputStream();
+            StringBuilder sw = new StringBuilder();
+            
+            int c;
+            while ((c = is.read()) != -1)
+            {
+                sw.append((char)c);
+            }
+            
+            String output = sw.toString();

Review Comment:
   I've tried running it with this change as suggested but I hit an error about 
unknown symbol for readAllBytes
   
   the module source level has been set to 11, I don't know whether this is 
related to openjdk so I've left 
   this section of code in its present state



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to