public void Apply()
            {
                string newRelativePath;
                string newShortRelativePath;

                if (!_oldFullPath.StartsWithIgnoreCase(_rootDirectory))
                {
                    if (IsFileAllowed(_rootDirectory, _fullPath, _fileSystem, _fileSystemFilter, out newRelativePath, out newShortRelativePath))
                    {
                        _entries.AddFile(newRelativePath, newShortRelativePath);
                    }

                    return;
                }

                var oldRelativePath = PathHelper.MakeRelative(_rootDirectory, _oldFullPath);

                if (IsFileAllowed(_rootDirectory, _fullPath, _fileSystem, _fileSystemFilter, out newRelativePath, out newShortRelativePath))
                {
                    _entries.RenameFile(oldRelativePath, newRelativePath, newShortRelativePath);
                }
                else
                {
                    _entries.DeleteFile(oldRelativePath);
                }
            }
            public void Apply()
            {
                if (!_directoryFullPath.StartsWithIgnoreCase(_rootDirectory))
                {
                    return;
                }

                Queue <string> directories = new Queue <string>();

                directories.Enqueue(_directoryFullPath);

                while (directories.Count > 0)
                {
                    var directoryPath         = directories.Dequeue();
                    var directory             = _fileSystem.DirectoryInfo.FromDirectoryName(directoryPath);
                    var relativeDirectoryPath = PathHelper.MakeRelative(_rootDirectory, directoryPath);

                    if (!directory.Exists)
                    {
                        continue;
                    }

                    // We don't want to add root directory
                    if (!string.IsNullOrEmpty(relativeDirectoryPath))
                    {
                        relativeDirectoryPath = PathHelper.EnsureTrailingSlash(relativeDirectoryPath);

                        // We don't add symlinks
                        if (directory.Attributes.HasFlag(FileAttributes.ReparsePoint))
                        {
                            continue;
                        }

                        if (!_fileSystemFilter.IsDirectoryAllowed(relativeDirectoryPath, directory.Attributes))
                        {
                            continue;
                        }

                        _entries.AddDirectory(relativeDirectoryPath, _fileSystem.ToShortRelativePath(directoryPath, _rootDirectory));
                    }

                    foreach (var entry in directory.EnumerateFileSystemInfos())
                    {
                        if (entry is DirectoryInfoBase)
                        {
                            directories.Enqueue(entry.FullName);
                        }
                        else
                        {
                            var relativeFilePath = PathHelper.MakeRelative(_rootDirectory, entry.FullName);

                            if (_fileSystemFilter.IsFileAllowed(relativeFilePath, entry.Attributes))
                            {
                                _entries.AddFile(relativeFilePath, _fileSystem.ToShortRelativePath(entry.FullName, _rootDirectory));
                            }
                        }
                    }
                }
            }
            public void Apply()
            {
                string relativePath;
                string shortRelativePath;

                if (IsFileAllowed(_rootDirectory, _fullPath, _fileSystem, _fileSystemFilter, out relativePath, out shortRelativePath))
                {
                    _entries.AddFile(relativePath, shortRelativePath);
                }
            }