org.xnap.util.launcher
Class LauncherManager

java.lang.Object
  extended by org.xnap.util.launcher.LauncherManager

public class LauncherManager
extends java.lang.Object

Manager class providing static functions which handle the OS dependent opening of files with the correct program.


Method Summary
 void add(Launcher launcher)
           
static java.lang.Process exec(java.lang.String[] args)
          Executes args using the system runtime.
static java.lang.Process exec(java.lang.String command, java.io.File[] files)
          Executes command.
 Launcher get(java.lang.String type)
           
static LauncherManager getInstance()
           
static boolean isEnabled()
           
 java.util.Iterator iterator()
           
static void open(java.io.File file)
           
static void open(java.net.URL url)
           
 void remove(Launcher launcher)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static LauncherManager getInstance()

isEnabled

public static boolean isEnabled()

open

public static void open(java.io.File file)
                 throws java.io.IOException
Throws:
java.io.IOException

open

public static void open(java.net.URL url)
                 throws java.io.IOException
Throws:
java.io.IOException

add

public void add(Launcher launcher)

get

public Launcher get(java.lang.String type)

iterator

public java.util.Iterator iterator()

remove

public void remove(Launcher launcher)

exec

public static java.lang.Process exec(java.lang.String[] args)
                              throws java.io.IOException
Executes args using the system runtime. Writes the output to console if "captureLauncherOutput" preference is true.

Throws:
java.io.IOException

exec

public static java.lang.Process exec(java.lang.String command,
                                     java.io.File[] files)
                              throws java.io.IOException
Executes command. Ever occurence of "{}" is replaced by files. If command does not contain "{}", files are appended.

Parameters:
command - tokenized by QuotedStringTokenizer
files - if null, no additional arguments are appended
Throws:
java.io.IOException


Copyright © 2001-2005 XNap Team. All Rights Reserved.