com.atlassian.bamboo.agent.installer.strategy
Class InstallIfMissingStrategy

java.lang.Object
  extended by com.atlassian.bamboo.agent.installer.strategy.InstallIfMissingStrategy
All Implemented Interfaces:
InstallStrategy

public class InstallIfMissingStrategy
extends java.lang.Object

This strategy will install a file only if it does not exist already. It has no real installation method, instead, it delegates the call to supplied chained strategy.


Field Summary
protected static boolean IS_UNIX
           
 
Constructor Summary
InstallIfMissingStrategy(InstallStrategy chainedStrategy)
          Creates strategy object and links it with supplied strategy.
 
Method Summary
protected  java.io.File getDestFile(InstallableFile file)
          Returns the destination of supplied file.
protected  java.io.InputStream getResourceAsStream(java.lang.String name)
           
 void install(InstallableFile file)
          This method invokes installation method on chained strategy if the file is missing.
protected  void setExecutable(InstallableFile file)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IS_UNIX

protected static final boolean IS_UNIX
Constructor Detail

InstallIfMissingStrategy

public InstallIfMissingStrategy(InstallStrategy chainedStrategy)
Creates strategy object and links it with supplied strategy.

Parameters:
chainedStrategy - the strategy that will handle all installation requests
Method Detail

install

public void install(InstallableFile file)
             throws java.io.IOException
This method invokes installation method on chained strategy if the file is missing.

Parameters:
file - the file to install
Throws:
java.io.IOException

setExecutable

protected void setExecutable(InstallableFile file)

getDestFile

protected java.io.File getDestFile(InstallableFile file)
Returns the destination of supplied file.

Parameters:
file - the file for which we would like to know the installation destination path
Returns:
destination file

getResourceAsStream

protected java.io.InputStream getResourceAsStream(java.lang.String name)


Copyright © 2011 Atlassian. All Rights Reserved.