AppMetrics.Backup.BackupHandler.MoveOldZipFiles C# (CSharp) Method

MoveOldZipFiles() static private method

static private MoveOldZipFiles ( string dataStoragePath ) : void
dataStoragePath string
return void
        static void MoveOldZipFiles(string dataStoragePath)
        {
            foreach (var dirPath in Directory.GetDirectories(dataStoragePath))
            {
                foreach (var filePath in Directory.GetFiles(dirPath, "*.zip", SearchOption.TopDirectoryOnly))
                {
                    var newPath = Path.Combine(dirPath, GetHierarchyName(filePath));
                    var newDir = Path.GetDirectoryName(newPath);
                    if (!Directory.Exists(newDir))
                        Directory.CreateDirectory(newDir);
                    File.Move(filePath, newPath);
                }
            }
        }