Esempio n. 1
0
 private void ValidateFileExists(string path)
 {
     if (!_fileSystemManager.FileExists(path))
     {
         throw new WizardStepException(path + " does not exist");
     }
 }
Esempio n. 2
0
        public void CreateCacheIfNotExists()
        {
            if (!_fileSystemManager.FileExists(_environmentSettingsProvider.LocalDatabasePath))
            {
                CreateDatabaseFile();
            }

            CreateTablesIfNotExists();
        }
        protected override void DoValidate()
        {
            var webConfigPath = Model.CurrentProfile.WebConfigSettings.NewWebConfigPath;

            if (string.IsNullOrEmpty(webConfigPath) || !_fileSystemManager.FileExists(webConfigPath))
            {
                throw new WizardStepException(webConfigPath + " does not exist");
            }
        }
Esempio n. 4
0
        private Optional <InputFile> ReadInputFileFromDisk(Optional <string> optionalFile)
        {
            var result = Optional <InputFile> .None();

            optionalFile.Do(file =>
            {
                if (!_fileSystem.FileExists(file))
                {
                    throw new InvalidCommandLineArgumentsException($"Can't find file {file}");
                }

                result = Optional <InputFile> .Some(new InputFile(Path.GetFileName(file),
                                                                  _fileSystem.ReadAllText(file),
                                                                  new PathDescriptor(file)));
            });

            return(result);
        }
Esempio n. 5
0
 public bool FileExists(ILocalPath fileLocalPath)
 {
     return(_fileSystemManager.FileExists(fileLocalPath.AsString()));
 }