info.aduna.platform.desktop.support
Class PosixDesktop

java.lang.Object
  extended by info.aduna.platform.desktop.DesktopBase
      extended by info.aduna.platform.desktop.support.PosixDesktop
All Implemented Interfaces:
Desktop
Direct Known Subclasses:
MacOSXDesktop, PosixGnomeDesktop, PosixKDEDesktop

public class PosixDesktop
extends DesktopBase

Platform implementation for *nix platforms.


Field Summary
static String[] EXECUTABLE_EXTENSIONS
          The extensions of executable files
 
Constructor Summary
PosixDesktop(Platform platform)
           
 
Method Summary
protected  String getDefaultApplication(String resource)
          Tries default applications for the given resource, and returns it or returns null if none was found successfully on the system.
 boolean isExecutable(String resource)
          Determines whether the specified file is executable.
 int openResource(String resource)
          Opens the specified resource in the appropriate external application.
protected  int openResource(String resource, boolean forceOpenInApp)
           
 
Methods inherited from class info.aduna.platform.desktop.DesktopBase
getPlatform, isExecutable, warnsWhenOpeningExecutable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXECUTABLE_EXTENSIONS

public static final String[] EXECUTABLE_EXTENSIONS
The extensions of executable files

Constructor Detail

PosixDesktop

public PosixDesktop(Platform platform)
Method Detail

openResource

public int openResource(String resource)
                 throws UnsupportedOperationException,
                        IOException
Description copied from interface: Desktop
Opens the specified resource in the appropriate external application. The resource may have the form of a URL, but this is not required. This method blocks until the external process that actually opens the resource completes, and then returns its exit code.

Returns:
exit code of the external process
Throws:
UnsupportedOperationException - when the Platform does not know how to handle the specified resource.
IOException - when an I/O error occurs.

openResource

protected int openResource(String resource,
                           boolean forceOpenInApp)
                    throws UnsupportedOperationException,
                           IOException
Throws:
UnsupportedOperationException
IOException

getDefaultApplication

protected String getDefaultApplication(String resource)
Tries default applications for the given resource, and returns it or returns null if none was found successfully on the system.


isExecutable

public boolean isExecutable(String resource)
                     throws IOException
Determines whether the specified file is executable.

Throws:
IOException


Copyright © 1997-2008 Aduna. All Rights Reserved.