Class DesktopUtil

java.lang.Object
org.nuiton.util.DesktopUtil

public class DesktopUtil extends Object
Utility class for methods to interact with Desktop Environment
Since:
2.4.3
Author:
Jean Couteau - couteau@codelutin.com
  • Constructor Details

    • DesktopUtil

      public DesktopUtil()
  • Method Details

    • browse

      public static void browse(URI uri)
      Method to open an URI in the user default web browser. It uses the Java Desktop API on Windows and Gnome environment and xdg-open on other platforms (non-gnome linux distribution for example). A Bug report have been opened in 2006 so that java.awt.Desktop can support all environments but it is not fixed yet : http://bugs.sun.com/view_bug.do?bug_id=6486393 this utility method should be removed when the bug is fixed.
      Parameters:
      uri - the URI to open
    • open

      public static void open(File file)
      Method to open an URI in the user default open client. It uses the Java Desktop API on Windows and Gnome environment and xdg-open on other platforms (non-gnome linux distribution for example). A Bug report have been opened in 2006 so that java.awt.Desktop can support all environments but it is not fixed yet : http://bugs.sun.com/view_bug.do?bug_id=6486393 this utility method should be removed when the bug is fixed.
      Parameters:
      file - the file to open
    • mail

      public static void mail(URI uri)
      Method to open an URI in the user default mail client. It uses the Java Desktop API on Windows and Gnome environment and xdg-email on other platforms (non-gnome linux distribution for example). A Bug report have been opened in 2006 so that java.awt.Desktop can support all environments but it is not fixed yet : http://bugs.sun.com/view_bug.do?bug_id=6486393 this utility method should be removed when the bug is fixed.
      Parameters:
      uri - the uri to open