Class 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 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