/// <summary> /// Moves existing files to a new location. /// </summary> /// <param name="env">The context.</param> /// <param name="filePaths">The file paths.</param> /// <param name="targetDirectoryPath">The target directory path.</param> /// <example> /// <code> /// var files = GetFiles("./publish/Cake.*"); /// MoveFiles(files, "destination"); /// </code> /// </example> /// <exception cref="ArgumentNullException"><paramref name="env"/> or <paramref name="filePaths"/> /// or <paramref name="targetDirectoryPath"/> is <see langword="null"/></exception> /// <exception cref="FileNotFoundException">The target directory do not exist.</exception> /// <exception cref="InvalidOperationException">The directory <paramref name="targetDirectoryPath"/>.FullPath /// do not exist.</exception> public static void MoveFiles(this IFileSystemEnvironment env, IEnumerable <FilePath> filePaths, DirectoryPath targetDirectoryPath) { FileMover.MoveFiles(env, filePaths, targetDirectoryPath); }
/// <summary> /// Moves existing files matching the specified pattern to a new location. /// </summary> /// <param name="env">The context.</param> /// <param name="pattern">The pattern.</param> /// <param name="targetDirectoryPath">The target directory path.</param> /// <example> /// <code> /// MoveFiles("./publish/Cake.*", "./destination"); /// </code> /// </example> /// <exception cref="ArgumentNullException"><paramref name="env"/> or <paramref name="pattern"/> /// or <paramref name="targetDirectoryPath"/> is <see langword="null"/></exception> /// <exception cref="FileNotFoundException">The target directory do not exist.</exception> public static void MoveFiles(this IFileSystemEnvironment env, string pattern, DirectoryPath targetDirectoryPath) { FileMover.MoveFiles(env, pattern, targetDirectoryPath); }