org.browsecode.helpers.installer.applications
Class ApplicationToInstallStub

java.lang.Object
  extended by org.browsecode.helpers.installer.applications.ApplicationToInstallStub
All Implemented Interfaces:
ApplicationToInstall
Direct Known Subclasses:
InstallApacheTomcat, InstallMySQL, InstallWebapp

public abstract class ApplicationToInstallStub
extends java.lang.Object
implements ApplicationToInstall


Nested Class Summary
 class ApplicationToInstallStub.SimpleSearcherStub
           
 
Nested classes/interfaces inherited from interface org.browsecode.helpers.installer.applications.ApplicationToInstall
ApplicationToInstall.ExeInstaller, ApplicationToInstall.Installer, ApplicationToInstall.MacInstaller, ApplicationToInstall.MsiInstaller, ApplicationToInstall.Searcher, ApplicationToInstall.TarGzipInstaller, ApplicationToInstall.ZipInstaller
 
Field Summary
protected  java.lang.String description
           
protected  java.lang.String installedInDirectory
           
protected  java.net.URL[] installerFiles
           
protected  java.net.URL[] installerWebsites
           
protected  java.lang.String name
           
 
Fields inherited from interface org.browsecode.helpers.installer.applications.ApplicationToInstall
INSTALLED_BUT_DIRECTORY_UNKNOWN
 
Constructor Summary
ApplicationToInstallStub()
           
 
Method Summary
 void addedToApplicationSet(ApplicationSet applicationSet)
          Called by ApplicationSet after the application has been added to the ApplicationSet.
 boolean getAskToFindPreviousInstalls()
          Returns whether to ask the user whether this application has been installed before.
 java.lang.String getDescription()
           
protected  ControlComputerInterface.FileMatches getInstalledFileMatches(ControlComputerInterface computer)
           
abstract  java.lang.String[] getInstalledFileName(int operatingSystem)
          A path and file that is installed when this program has been installed.
 java.lang.String getInstalledInDirectory()
          After installing the program, this is the directory it was installed into.
 ApplicationToInstall.Installer getInstaller(ControlComputerInterface machineToInstallOn, ApplicationSet applicationSet)
          An installer or a zip of the application.
protected  java.net.URL[] getInstallers()
           
 java.net.URL[] getInstallerURL()
          Any URLs that the application can be downloaded by hand, by users, if the application installer is not available or can't be used for any reason.
 java.lang.String getName()
           
 ApplicationToInstall.Searcher getSearcher()
           
 boolean getTryToFindPreviousInstalls()
          Returns true if it should search for the installation directiory, returns false if it should not search for the installation directory.
 void setAskUserIfInstalledBefore(boolean askUser)
           
 void setDescription(java.lang.String description)
           
 void setInstalledInDirectory(java.lang.String installedIn)
          After installing the program, this is the directory it was installed into.
 void setInstallers(java.net.URL[] installerFile)
          Set these in order of preference -- i.e. executables first, zip files (assumed to be platform independent) last.
 void setInstallerURL(java.net.URL[] installerWebsites)
          Put the array in order of priority -- highest priority first, lowest priority last.
 void setName(java.lang.String name)
           
 void setTryToFindPreviousInstalls(boolean tryToFind)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.browsecode.helpers.installer.applications.ApplicationToInstall
getInstallerDirections
 

Field Detail

name

protected java.lang.String name

description

protected java.lang.String description

installerFiles

protected java.net.URL[] installerFiles

installerWebsites

protected java.net.URL[] installerWebsites

installedInDirectory

protected java.lang.String installedInDirectory
Constructor Detail

ApplicationToInstallStub

public ApplicationToInstallStub()
Method Detail

addedToApplicationSet

public void addedToApplicationSet(ApplicationSet applicationSet)
Description copied from interface: ApplicationToInstall
Called by ApplicationSet after the application has been added to the ApplicationSet. This method should check the ApplicationSet to make sure that all needed applications are already in ApplicationSet, and if not, it should add them to the ApplicationSet (by calling ApplicationSet.addApplicationBefore(neededApplication,this))

Specified by:
addedToApplicationSet in interface ApplicationToInstall

getName

public java.lang.String getName()
Specified by:
getName in interface ApplicationToInstall

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface ApplicationToInstall

setName

public void setName(java.lang.String name)

setDescription

public void setDescription(java.lang.String description)

getInstaller

public ApplicationToInstall.Installer getInstaller(ControlComputerInterface machineToInstallOn,
                                                   ApplicationSet applicationSet)
Description copied from interface: ApplicationToInstall
An installer or a zip of the application. This file may be either an executable file or a zip. May also be null. This should be the only file required for installation. Pass in a ControlComputerInterface so it can check the OS information.

Specified by:
getInstaller in interface ApplicationToInstall
Returns:

getAskToFindPreviousInstalls

public boolean getAskToFindPreviousInstalls()
Description copied from interface: ApplicationToInstall
Returns whether to ask the user whether this application has been installed before. Return true for applications that may already have been installed on the machine. Return false for applications that have most likely not been installed, or can be installed multiple times, or for the main application.

Specified by:
getAskToFindPreviousInstalls in interface ApplicationToInstall
Returns:

getTryToFindPreviousInstalls

public boolean getTryToFindPreviousInstalls()
Description copied from interface: ApplicationToInstall
Returns true if it should search for the installation directiory, returns false if it should not search for the installation directory. (This depends upon whether dependent

Specified by:
getTryToFindPreviousInstalls in interface ApplicationToInstall
Returns:

setAskUserIfInstalledBefore

public void setAskUserIfInstalledBefore(boolean askUser)

setTryToFindPreviousInstalls

public void setTryToFindPreviousInstalls(boolean tryToFind)

getInstallerURL

public java.net.URL[] getInstallerURL()
Description copied from interface: ApplicationToInstall
Any URLs that the application can be downloaded by hand, by users, if the application installer is not available or can't be used for any reason. They will be recommended from first to last.

Specified by:
getInstallerURL in interface ApplicationToInstall
Returns:

setInstallers

public void setInstallers(java.net.URL[] installerFile)
Set these in order of preference -- i.e. executables first, zip files (assumed to be platform independent) last.

Parameters:
installerFile -

getInstallers

protected java.net.URL[] getInstallers()

setInstallerURL

public void setInstallerURL(java.net.URL[] installerWebsites)
Put the array in order of priority -- highest priority first, lowest priority last.

Parameters:
installerWebsites -

setInstalledInDirectory

public void setInstalledInDirectory(java.lang.String installedIn)
Description copied from interface: ApplicationToInstall
After installing the program, this is the directory it was installed into. Please set it after installation.

Specified by:
setInstalledInDirectory in interface ApplicationToInstall

getInstalledInDirectory

public java.lang.String getInstalledInDirectory()
Description copied from interface: ApplicationToInstall
After installing the program, this is the directory it was installed into. Please set it after installation.

Specified by:
getInstalledInDirectory in interface ApplicationToInstall
Returns:

getInstalledFileName

public abstract java.lang.String[] getInstalledFileName(int operatingSystem)
A path and file that is installed when this program has been installed. Return any possibilites that indicate that this program is installed. You may use RegExp. Some examples: Apache Tomcat would return ".*jakarta.* /webapps/" (note that space is put in because java docs won't let you put in a * immediately followed by /) MySQL would return "mysqldump.exe" and "mysqldump" The path that these files are in will be searched for in the installation process and possibly used later (in tomcat's example, or in mysql's example) If the path isn't found, the user will be prompted with installation instructions. Paths that are directories should end in a '/' and files should not end in a slash.

Parameters:
operatingSystem - The OS that the target platform is running on. This will be gathered from org.browsecode.helpers.controlcomputer.ControlComputerInterface.
Returns:

getInstalledFileMatches

protected ControlComputerInterface.FileMatches getInstalledFileMatches(ControlComputerInterface computer)

getSearcher

public ApplicationToInstall.Searcher getSearcher()
Specified by:
getSearcher in interface ApplicationToInstall