Class DesktopUtil

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

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

    Constructors 
    Constructor Description
    DesktopUtil()  
  • Method Summary

    Modifier and Type Method Description
    static void browse​(java.net.URI uri)
    Method to open an URI in the user default web browser.
    static void mail​(java.net.URI uri)
    Method to open an URI in the user default mail client.
    static void open​(java.io.File file)
    Method to open an URI in the user default open client.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • browse

      public static void browse​(java.net.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​(java.io.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​(java.net.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