public static void openMacURL(String url) {
    if (!url.startsWith("http://")) {
      url = "file://" + url;

      // replace spaces with %20 for the url
      // can't just use URLEncoder, since that 
      // makes slashes into %2F characters, which is no good. 
      if (url.indexOf(' ') != -1) {
        StringBuffer sb = new StringBuffer();
        char c[] = url.toCharArray();
        for (int i = 0; i < c.length; i++) {
          if (c[i] == ' ') {
            sb.append("%20");
          } else {
            sb.append(c[i]);
          }
        }
        url = sb.toString();
      }
    }
    
    Class fMan = null;
    
    try
    {
      fMan = Class.forName("com.apple.eio.FileManager");
    }
    catch (Exception e)
    {
      System.err.println("[WARN] unable to load class: com.apple.eio.FileManager");
      return;
    }
    
    try
    {
      Method m = fMan.getMethod( "openURL", new Class[] {String.class});
      m.invoke(null, new Object[]{url});
    }
    catch (Exception e)
    {
      System.err.println("[WARN] unable to invoke method: com.apple.eio.FileManager.openURL()");
    }
  }