Class OSUtils


  • public class OSUtils
    extends java.lang.Object
    Class used to deal specifically with the operating system
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.logging.Logger logger  
      private static java.lang.String SEPARATOR  
    • Constructor Summary

      Constructors 
      Constructor Description
      OSUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.String[] getBrowserExecString​(java.lang.String url)
      What should we run to launch a browser?
      static java.lang.String getOperatingSystem()
      What OS are we using?
      static void launchBrowser​(java.lang.String url)
      Launches the web browser based on a given operating system
      static boolean onMacOSX()
      Does the OS look like Mac OS X?
      static boolean onUnix()
      Does the OS look like some sort of unix?
      static boolean onWindows()
      Does the OS look like some sort of Windows?
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        private static final java.util.logging.Logger logger
      • SEPARATOR

        private static final java.lang.String SEPARATOR
    • Constructor Detail

      • OSUtils

        public OSUtils()
    • Method Detail

      • getOperatingSystem

        public static java.lang.String getOperatingSystem()
        What OS are we using?
        Returns:
        The operating system name.
      • onMacOSX

        public static boolean onMacOSX()
        Does the OS look like Mac OS X?
        Returns:
        True if Mac OS X appears to be present.
      • onUnix

        public static boolean onUnix()
        Does the OS look like some sort of unix?
        Returns:
        True we hope.
      • onWindows

        public static boolean onWindows()
        Does the OS look like some sort of Windows?
        Returns:
        True if Windows appears to be present.
      • launchBrowser

        public static final void launchBrowser​(java.lang.String url)
        Launches the web browser based on a given operating system
        Parameters:
        url - The URL to launch
      • getBrowserExecString

        private static final java.lang.String[] getBrowserExecString​(java.lang.String url)
        What should we run to launch a browser?
        Parameters:
        url - The URL to launch
        Returns:
        An OS-dependent array of commands to exec a browser.
        See Also:
        launchBrowser(String)