Lucene.Net.Index.TestSnapshotDeletionPolicy.CopyFiles C# (CSharp) Method

CopyFiles() private method

private CopyFiles ( Directory dir, IndexCommit cp ) : void
dir Directory
cp IndexCommit
return void
        private void CopyFiles(Directory dir, IndexCommit cp)
        {
            // While we hold the snapshot, and nomatter how long
            // we take to do the backup, the IndexWriter will
            // never delete the files in the snapshot:
            ICollection<string> files = cp.FileNames;
            foreach (String fileName in files)
            {
                // NOTE: in a real backup you would not use
                // readFile; you would need to use something else
                // that copies the file to a backup location.  this
                // could even be a spawned shell process (eg "tar",
                // "zip") that takes the list of files and builds a
                // backup.
                ReadFile(dir, fileName);
            }
        }