private string CreateSanitizedFileName(string newName) { var newFileName = newName + this.Extension; var validFileName = StringCleaner.RemoveInvalidFileNameCharacters(newFileName); return(validFileName); }
private string CreateSanitizedDirectoryName(Regex directoryRegex, string newName) { Group directoryRegexGroup = directoryRegex.Match(this.Filepath).Groups[1]; string sanitizedNewName = StringCleaner.RemoveInvalidDirectoryCharacters(newName); string newDirectory = directoryRegexGroup.Replace(this.Directory, sanitizedNewName); return(newDirectory); }