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()
      • isHighSierra

        public static boolean isHighSierra()
      • isHighSierraOrLater

        public static boolean isHighSierraOrLater()
      • isMojave

        public static boolean isMojave()
      • isMojaveOrLater

        public static boolean isMojaveOrLater()
      • isCatalina

        public static boolean isCatalina()
      • isCatalinaOrLater

        public static boolean isCatalinaOrLater()
      • isBigSur

        public static boolean isBigSur()
      • isBigSurOrLater

        public static boolean isBigSurOrLater()
      • 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 macOS.
        version or "unknown", if not known.
      • getDesktopDirectory

        public static Path getDesktopDirectory()
      • getLocalApplicationSupportDirectory

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

        public static Path getUsersMusicDirectory()
        User's music folder. ~/Music on macOS, ~\Music on Vista/Win7, ~\My Documents\My Music on Windows XP.
        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.
        file - file
        true, if we succeeded at moving this file to the trash - false, if it is simply deleted
        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.
        file - file
        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.
        url - url
        IOException - if something goes wrong.
      • getExternalApplications

        public static OperatingSystem.ExternalApplication[] getExternalApplications​(URL url)
        Lists the available applications for the given URL.
        url - url
        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.
        priority - priority
      • getSystemAppearance

        public static String getSystemAppearance()