de.bianet
Class Browser

java.lang.Object
  |
  +--de.bianet.Browser

public final class Browser
extends java.lang.Object

Startet den Standard-Browser.

Author:
ARGE101

Field Summary
(package private) static java.lang.String[] badEndings
           
 
Constructor Summary
Browser(java.lang.String url)
          Deprecated. As of v1.4 the preferred way to open a browser is by using Browser.open(url)
 
Method Summary
private static java.lang.String fixupURLForWindows(java.lang.String url)
           
static boolean isWindows()
          Checks if the OS is windows.
private static java.lang.String maybeFixupURLForWindows(java.lang.String url)
          If the default browser is Internet Explorer 5.0 or greater, the URL.DLL program fails if the url ends with .htm or .html .
static void open(java.lang.String url)
          Starts the default browser for the current platform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

badEndings

static final java.lang.String[] badEndings
Constructor Detail

Browser

public Browser(java.lang.String url)
        throws java.lang.InterruptedException,
               java.io.IOException
Deprecated. As of v1.4 the preferred way to open a browser is by using Browser.open(url)

Starts the default browser for the current platform.

Parameters:
url - The link to point the browser to.
Method Detail

open

public static void open(java.lang.String url)
                 throws java.lang.InterruptedException,
                        java.io.IOException
Starts the default browser for the current platform.

Parameters:
url - The link to point the browser to.
java.lang.InterruptedException
java.io.IOException

maybeFixupURLForWindows

private static java.lang.String maybeFixupURLForWindows(java.lang.String url)
If the default browser is Internet Explorer 5.0 or greater, the URL.DLL program fails if the url ends with .htm or .html . This problem is described by Microsoft at http://support.microsoft.com/support/kb/articles/Q283/2/25.ASP Of course, their suggested workaround is to use the classes from the microsoft Java SDK, but fortunately another workaround does exist. If you alter the url slightly so it no longer ends with ".htm", the URL can launch successfully. The logic here appends a null query string onto the end of the URL if none is already present, or a bogus query parameter if there is already a query string ending in ".htm"


fixupURLForWindows

private static java.lang.String fixupURLForWindows(java.lang.String url)

isWindows

public static boolean isWindows()
Checks if the OS is windows.

Returns:
true if it is, false if it's not.