Class InstallIfMissingStrategy
- java.lang.Object
-
- com.atlassian.bamboo.agent.bootstrap.shared.installation.strategy.InstallIfMissingStrategy
-
- All Implemented Interfaces:
InstallStrategy
public class InstallIfMissingStrategy extends 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.
-
-
Constructor Summary
Constructors Constructor Description InstallIfMissingStrategy(String homeDir, InstallStrategy chainedStrategy)
Creates strategy object and links it with supplied strategy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected File
getDestFile(InstallableFile file)
Returns the destination of supplied file.protected InputStream
getResourceAsStream(String name)
void
install(InstallableFile file)
This method invokes installation method on chained strategy if the file is missing.
-
-
-
Constructor Detail
-
InstallIfMissingStrategy
public InstallIfMissingStrategy(String homeDir, 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 IOException
This method invokes installation method on chained strategy if the file is missing.- Parameters:
file
- the file to install- Throws:
IOException
-
getDestFile
protected 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 InputStream getResourceAsStream(String name)
-
-