org.terrier.applications.desktop.filehandling
Class MultiOSFileOpener

java.lang.Object
  extended by org.terrier.applications.desktop.filehandling.MultiOSFileOpener
All Implemented Interfaces:
FileOpener

public class MultiOSFileOpener
extends java.lang.Object
implements FileOpener

A file opener implementation that uses a Java 6 AWT API to open the prescribed file.

Since:
3.5
Author:
Craig Macdonald

Constructor Summary
MultiOSFileOpener()
           
 
Method Summary
 void load()
          Perform any loading in of data the implementor may require.
static void open(java.io.File file)
          Opens the given File in the system default viewer application.
 void open(java.lang.String filename)
          Opens the file with the given name, using either a pre-defined, or a user-defined application.
 void save()
          Perform any saving to disk of data the implementor may requires.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiOSFileOpener

public MultiOSFileOpener()
Method Detail

load

public void load()
Perform any loading in of data the implementor may require. This is unsupported by this implemented class.

Specified by:
load in interface FileOpener

open

public static void open(java.io.File file)
                 throws java.io.IOException
Opens the given File in the system default viewer application.

Parameters:
file - the File to open
Throws:
java.io.IOException - if an application couldn't be found or if the File failed to launch

open

public void open(java.lang.String filename)
          throws java.lang.Exception
Opens the file with the given name, using either a pre-defined, or a user-defined application. This interface should be implemented by classes that should work for Linux or Windows.

Specified by:
open in interface FileOpener
Parameters:
filename - the name of the file to open.
Throws:
java.lang.Exception

save

public void save()
Perform any saving to disk of data the implementor may requires. This is unsupported by this implemented class.

Specified by:
save in interface FileOpener


Terrier 3.5. Copyright © 2004-2011 University of Glasgow