Index: Migration/Scripts/src/Migration.Scripts.Data/UpgradeScript.cs
===================================================================
diff -u -r74c998ad1d6edfc4fff8872438a84a5bd9cb0d98 -r59e7b9604b09b292bf3b76c729751e7622d36bce
--- Migration/Scripts/src/Migration.Scripts.Data/UpgradeScript.cs (.../UpgradeScript.cs) (revision 74c998ad1d6edfc4fff8872438a84a5bd9cb0d98)
+++ Migration/Scripts/src/Migration.Scripts.Data/UpgradeScript.cs (.../UpgradeScript.cs) (revision 59e7b9604b09b292bf3b76c729751e7622d36bce)
@@ -20,6 +20,7 @@
// All rights reserved.
using System;
+using Core.Common.Utils;
using Migration.Scripts.Data.Exceptions;
namespace Migration.Scripts.Data
@@ -76,36 +77,34 @@
}
///
- /// Uses to upgrade to .
+ /// Uses to upgrade to .
///
- /// The source file to upgrade from.
- /// The target file to upgrade to.
- /// Thrown when:
+ /// The source file to upgrade from.
+ /// The target file to upgrade to.
+ /// Thrown when or
+ /// is invalid.
+ /// A valid path:
///
- /// - is null,
- /// - is null.
- ///
+ /// - is not empty or null,
+ /// - does not consist out of only whitespace characters,
+ /// - does not contain an invalid character,
+ /// - does not end with a directory or path separator (empty file name).
+ ///
/// Thrown when upgrading failed.
- public void Upgrade(IVersionedFile source, IVersionedFile target)
+ public void Upgrade(string sourceLocation, string targetLocation)
{
- if (source == null)
- {
- throw new ArgumentNullException(nameof(source));
- }
- if (target == null)
- {
- throw new ArgumentNullException(nameof(target));
- }
- PerformUpgrade(source, target);
+ IOUtils.ValidateFilePath(sourceLocation);
+ IOUtils.ValidateFilePath(targetLocation);
+ PerformUpgrade(sourceLocation, targetLocation);
}
///
- /// Performs the upgrade on .
+ /// Performs the upgrade on .
///
- /// The source file to upgrade from.
- /// The target file to upgrade to.
- /// The and has been verified in .
+ /// The source file to upgrade from.
+ /// The target file to upgrade to.
+ /// The and has been verified in .
/// Thrown when upgrading failed.
- protected abstract void PerformUpgrade(IVersionedFile source, IVersionedFile target);
+ protected abstract void PerformUpgrade(string sourceLocation, string targetLocation);
}
}
\ No newline at end of file