Class ProcessUtils


  • public class ProcessUtils
    extends java.lang.Object
    Helper class for processes.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.Boolean m_IsAndroid
      whether the OS is Android.
      protected static java.lang.Boolean m_IsLinux
      whether the OS is Linux.
      protected static java.lang.Boolean m_IsWindows
      whether the OS is Windows.
    • Constructor Summary

      Constructors 
      Constructor Description
      ProcessUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void destroy​(java.lang.Process process)
      Destroys the process.
      static void destroy​(java.lang.Process process, boolean force)
      Destroys the process.
      static boolean isAndroid()
      Checks whether the operating system is Android.
      static boolean isLinux()
      Checks whether the operating system is Linux (but not Android).
      static boolean isWindows()
      Checks whether the operating system is Windows.
      • Methods inherited from class java.lang.Object

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

      • m_IsWindows

        protected static java.lang.Boolean m_IsWindows
        whether the OS is Windows.
      • m_IsLinux

        protected static java.lang.Boolean m_IsLinux
        whether the OS is Linux.
      • m_IsAndroid

        protected static java.lang.Boolean m_IsAndroid
        whether the OS is Android.
    • Constructor Detail

      • ProcessUtils

        public ProcessUtils()
    • Method Detail

      • isWindows

        public static boolean isWindows()
        Checks whether the operating system is Windows.
        Returns:
        true if the OS is Windows flavor
      • isAndroid

        public static boolean isAndroid()
        Checks whether the operating system is Android.
        Returns:
        true if the OS is Android flavor
      • isLinux

        public static boolean isLinux()
        Checks whether the operating system is Linux (but not Android).
        Returns:
        true if the OS is Linux flavor (but not Android)
      • destroy

        public static void destroy​(java.lang.Process process)
        Destroys the process. Does not force the exit.
        Parameters:
        process - the process to destroy
      • destroy

        public static void destroy​(java.lang.Process process,
                                   boolean force)
        Destroys the process.
        Parameters:
        process - the process to destroy
        force - whether to force the exit without giving the process a chance to clean up