Class OperatingSystem

    • Method Detail

      • isMac

        public static boolean isMac()
      • isLeopard

        public static boolean isLeopard()
      • isLeopardOrLater

        public static boolean isLeopardOrLater()
      • isSnowLeopard

        public static boolean isSnowLeopard()
      • isSnowLeopardOrLater

        public static boolean isSnowLeopardOrLater()
      • isLion

        public static boolean isLion()
      • isLionOrLater

        public static boolean isLionOrLater()
      • isMountainLion

        public static boolean isMountainLion()
      • isMountainLionOrLater

        public static boolean isMountainLionOrLater()
      • isMavericks

        public static boolean isMavericks()
      • isMavericksOrLater

        public static boolean isMavericksOrLater()
      • isYosemite

        public static boolean isYosemite()
      • isYosemiteOrLater

        public static boolean isYosemiteOrLater()
      • isElCapitan

        public static boolean isElCapitan()
      • isElCapitanOrLater

        public static boolean isElCapitanOrLater()
      • isMojave

        public static boolean isMojave()
      • isMojaveOrLater

        public static boolean isMojaveOrLater()
      • isCatalina

        public static boolean isCatalina()
      • isCatalinaOrLater

        public static boolean isCatalinaOrLater()
      • isWindows

        public static boolean isWindows()
      • is64Bit

        public static boolean is64Bit()
      • isI386

        public static boolean isI386()
      • isPowerPC

        public static boolean isPowerPC()
      • isVista

        public static boolean isVista()
      • isXP

        public static boolean isXP()
      • isWin7

        public static boolean isWin7()
      • isWin8

        public static boolean isWin8()
      • isWin8_1

        public static boolean isWin8_1()
      • isWin10

        public static boolean isWin10()
      • isVistaOrLater

        public static boolean isVistaOrLater()
      • isXPOrLater

        public static boolean isXPOrLater()
      • isWin7OrLater

        public static boolean isWin7OrLater()
      • isWin8OrLater

        public static boolean isWin8OrLater()
      • isWin8_1OrLater

        public static boolean isWin8_1OrLater()
      • isWin10OrLater

        public static boolean isWin10OrLater()
      • getJavaRuntimeSupportVersion

        public static String getJavaRuntimeSupportVersion()
        Version string for the JavaRuntimeSupportVersion.framework, available only on OS X.
        Returns:
        version or "unknown", if not known.
      • getDesktopDirectory

        public static Path getDesktopDirectory()
      • getLocalApplicationSupportDirectory

        public static Path getLocalApplicationSupportDirectory()
        Local app data folder. ~/Library/Application Support on OS X, ~\AppData\Local on Vista, ~\Local Settings\Application Data on Windows XP.
        Returns:
        local app data folder
        See Also:
        OperatingSystemSPI
      • getUsersMusicDirectory

        public static Path getUsersMusicDirectory()
        User's music folder. ~/Music on OS X, ~\Music on Vista/Win7, ~\My Documents\My Music on Windows XP.
        Returns:
        user's music folder
      • moveToTrashIfPossible

        public static boolean moveToTrashIfPossible​(Path file)
                                             throws IOException
        Tries to move a file to the trash. If that's not possible (for whatever reason) deletes the file.
        Parameters:
        file - file
        Returns:
        true, if we succeeded at moving this file to the trash - false, if it is simply deleted
        Throws:
        IOException - if the file can't be moved/deleted
      • showInFileBrowser

        public static void showInFileBrowser​(Path file)
                                      throws IOException
        Shows the file in the system file browser.
        Parameters:
        file - file
        Throws:
        IOException - if things go wrong...
      • openWithExternalApplication

        public static void openWithExternalApplication​(URL url)
                                                throws IOException
        Opens the given URL in an external application, typically the OS's default application for the given resource.
        Parameters:
        url - url
        Throws:
        IOException - if something goes wrong.
      • getExternalApplications

        public static OperatingSystem.ExternalApplication[] getExternalApplications​(URL url)
        Lists the available applications for the given URL.
        Parameters:
        url - url
        Returns:
        list of applications - the first one should be the default application
      • setThreadPriority

        public static void setThreadPriority​(int priority)
        Tries to force-set the given thread priority using native APIs.
        Parameters:
        priority - priority
      • getSystemAppearance

        public static String getSystemAppearance()