private void ValidateFileExists(string path) { if (!_fileSystemManager.FileExists(path)) { throw new WizardStepException(path + " does not exist"); } }
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"); } }
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); }
public bool FileExists(ILocalPath fileLocalPath) { return(_fileSystemManager.FileExists(fileLocalPath.AsString())); }