com.codemercs.install
Class PlatformInstaller

java.lang.Object
  extended by com.codemercs.install.PlatformInstaller
Direct Known Subclasses:
LinuxInstaller

abstract class PlatformInstaller
extends java.lang.Object

Base class for platform-specific installation classes.

Author:
Eberhard Fahle

Field Summary
protected  java.io.File jarFile
          The file for the jar
protected  java.lang.String jarName
          The name of the jar that contains the native-interface
protected  java.io.File libDir
          The directory where the iowkit is installed
protected  java.lang.String libFileName
          The is the plattform-specific name of the library
protected  java.lang.String libName
          The the name of the library we want to install
protected  java.io.File target
          The library
 
Constructor Summary
protected PlatformInstaller(java.lang.String libLocation, java.lang.String libName, java.lang.String jarName)
          Creates a new PlatformInstaller.
 
Method Summary
 boolean copyJar(java.io.File javaExtDir)
          Copy the jar-file to the java.ext.dirs.
abstract  boolean copyLib(java.io.File javaLibDir)
          Copy the library to the java.library.path.
 java.io.File getJavaExtentionsDirectory()
          Gets the first entry of the java.ext.dirs.
 java.io.File getJavaLibraryDirectory()
          Gets the first entry of the java.library.path.
 boolean jarExists()
          Tests wether the jarfile to be installed exits.
 boolean libraryExists()
          Tests wether the library to be installed exits.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

libName

protected final java.lang.String libName
The the name of the library we want to install


libFileName

protected final java.lang.String libFileName
The is the plattform-specific name of the library


libDir

protected java.io.File libDir
The directory where the iowkit is installed


target

protected java.io.File target
The library


jarName

protected java.lang.String jarName
The name of the jar that contains the native-interface


jarFile

protected java.io.File jarFile
The file for the jar

Constructor Detail

PlatformInstaller

protected PlatformInstaller(java.lang.String libLocation,
                            java.lang.String libName,
                            java.lang.String jarName)
Creates a new PlatformInstaller.

Parameters:
libLocation - a String that contains the directory where the lib ist to be installed.
libName - the name of the library that is to be installed
jarName - the name of the jar-file that contains the native interface-definitions
Method Detail

libraryExists

public boolean libraryExists()
Tests wether the library to be installed exits.

Returns:
boolean True if the library exist, false otherwise.

jarExists

public boolean jarExists()
Tests wether the jarfile to be installed exits.

Returns:
boolean True if the jarfile exists and can be read for copying, false otherwise.

getJavaLibraryDirectory

public java.io.File getJavaLibraryDirectory()
Gets the first entry of the java.library.path.

Returns:
File the filedescritptor for the first entry of the java.library.path. Return null :
If there are no entries in the system.property
If the directory does not exist
If we cannot write into the directory

getJavaExtentionsDirectory

public java.io.File getJavaExtentionsDirectory()
Gets the first entry of the java.ext.dirs.

Returns:
File the filedescriptor for the first entry of the java.ext.dirs. Return null :
If there are no entries in the system.property
If the directory does not exist
If we cannot write into the directory

copyLib

public abstract boolean copyLib(java.io.File javaLibDir)
Copy the library to the java.library.path. The implementation of this method is platform-specific.

Parameters:
javaLibDir - the directory for the library
Returns:
boolean true if the lib was sucessfully copied, false otherwise.

copyJar

public boolean copyJar(java.io.File javaExtDir)
Copy the jar-file to the java.ext.dirs.

Parameters:
javaExtDir - the directory for the jar-file
Returns:
boolean true if the jar was sucessfully copied, false otherwise.