diff --git a/Duplicati/UnitTest/BackendToolTests.cs b/Duplicati/UnitTest/BackendToolTests.cs index 070cd5604..77689a36e 100755 --- a/Duplicati/UnitTest/BackendToolTests.cs +++ b/Duplicati/UnitTest/BackendToolTests.cs @@ -1,23 +1,23 @@ -// Copyright (C) 2024, The Duplicati Team -// https://duplicati.com, hello@duplicati.com -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. +// Copyright (C) 2024, The Duplicati Team +// https://duplicati.com, hello@duplicati.com +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; using System.Collections.Generic; using System.IO; @@ -25,7 +25,6 @@ using System.Linq; using Duplicati.Library.Interface; using Duplicati.Library.Main; using NUnit.Framework; -using Microsoft.AspNetCore.Mvc; namespace Duplicati.UnitTest { diff --git a/Duplicati/UnitTest/BorderTests.cs b/Duplicati/UnitTest/BorderTests.cs index 73013e9a6..cc975dda8 100644 --- a/Duplicati/UnitTest/BorderTests.cs +++ b/Duplicati/UnitTest/BorderTests.cs @@ -1,4 +1,4 @@ -// Copyright (C) 2024, The Duplicati Team +// Copyright (C) 2024, The Duplicati Team // https://duplicati.com, hello@duplicati.com // // Permission is hereby granted, free of charge, to any person obtaining a @@ -25,7 +25,6 @@ using System.IO; using System.Linq; using System.Collections.Generic; using Duplicati.Library.Interface; -using Microsoft.AspNetCore.Mvc; namespace Duplicati.UnitTest { diff --git a/Duplicati/UnitTest/ControllerTests.cs b/Duplicati/UnitTest/ControllerTests.cs index c02cf1464..f9ec1e18c 100644 --- a/Duplicati/UnitTest/ControllerTests.cs +++ b/Duplicati/UnitTest/ControllerTests.cs @@ -24,7 +24,6 @@ using System.Linq; using Duplicati.Library.Interface; using Duplicati.Library.Main; using NUnit.Framework; -using Microsoft.AspNetCore.Mvc; namespace Duplicati.UnitTest { diff --git a/Duplicati/UnitTest/DisruptionTests.cs b/Duplicati/UnitTest/DisruptionTests.cs index 88d8832c7..82a55c1f8 100644 --- a/Duplicati/UnitTest/DisruptionTests.cs +++ b/Duplicati/UnitTest/DisruptionTests.cs @@ -31,7 +31,6 @@ using Duplicati.Library.Main.Volumes; using NUnit.Framework; using IFileEntry = Duplicati.Library.Interface.IFileEntry; using Utility = Duplicati.Library.Utility.Utility; -using Microsoft.AspNetCore.Mvc; namespace Duplicati.UnitTest { diff --git a/Duplicati/UnitTest/FilterTest.cs b/Duplicati/UnitTest/FilterTest.cs index 4af9b51c9..a92f40b6e 100644 --- a/Duplicati/UnitTest/FilterTest.cs +++ b/Duplicati/UnitTest/FilterTest.cs @@ -1,4 +1,4 @@ -// Copyright (C) 2024, The Duplicati Team +// Copyright (C) 2024, The Duplicati Team // https://duplicati.com, hello@duplicati.com // // Permission is hereby granted, free of charge, to any person obtaining a @@ -27,7 +27,6 @@ using Duplicati.Library.Common.IO; using Duplicati.Library.Interface; using Duplicati.Library.Utility; using NUnit.Framework; -using Microsoft.AspNetCore.Mvc; namespace Duplicati.UnitTest { diff --git a/Duplicati/UnitTest/Issue1410.cs b/Duplicati/UnitTest/Issue1410.cs index 0e978de92..a57e6390c 100644 --- a/Duplicati/UnitTest/Issue1410.cs +++ b/Duplicati/UnitTest/Issue1410.cs @@ -1,4 +1,4 @@ -// Copyright (C) 2024, The Duplicati Team +// Copyright (C) 2024, The Duplicati Team // https://duplicati.com, hello@duplicati.com // // Permission is hereby granted, free of charge, to any person obtaining a @@ -25,7 +25,6 @@ using NUnit.Framework; using System.Linq; using System.Collections.Generic; using Duplicati.Library.Interface; -using Microsoft.AspNetCore.Mvc; namespace Duplicati.UnitTest { diff --git a/Duplicati/UnitTest/Issue1723.cs b/Duplicati/UnitTest/Issue1723.cs index 110a54d77..db7b747bd 100644 --- a/Duplicati/UnitTest/Issue1723.cs +++ b/Duplicati/UnitTest/Issue1723.cs @@ -1,4 +1,4 @@ -// Copyright (C) 2024, The Duplicati Team +// Copyright (C) 2024, The Duplicati Team // https://duplicati.com, hello@duplicati.com // // Permission is hereby granted, free of charge, to any person obtaining a @@ -23,7 +23,6 @@ using System; using System.IO; using System.Linq; using NUnit.Framework; -using Microsoft.AspNetCore.Mvc; namespace Duplicati.UnitTest { diff --git a/Duplicati/UnitTest/ProblematicPathTests.cs b/Duplicati/UnitTest/ProblematicPathTests.cs index e0edab6a9..a0baab6eb 100644 --- a/Duplicati/UnitTest/ProblematicPathTests.cs +++ b/Duplicati/UnitTest/ProblematicPathTests.cs @@ -29,7 +29,6 @@ using Duplicati.Library.Main; using Duplicati.Library.Utility; using NUnit.Framework; using Utility = Duplicati.Library.Utility.Utility; -using Microsoft.AspNetCore.Mvc; namespace Duplicati.UnitTest { @@ -51,10 +50,10 @@ namespace Duplicati.UnitTest const string asterisk = "*"; string dirWithAsterisk = Path.Combine(this.DATAFOLDER, asterisk); // Windows does not support literal asterisks in paths. - if (!Platform.IsClientWindows) - { - SystemIO.IO_OS.DirectoryCreate(dirWithAsterisk); - TestUtils.WriteFile(SystemIO.IO_OS.PathCombine(dirWithAsterisk, file), new byte[] {0}); + if (!Platform.IsClientWindows) + { + SystemIO.IO_OS.DirectoryCreate(dirWithAsterisk); + TestUtils.WriteFile(SystemIO.IO_OS.PathCombine(dirWithAsterisk, file), new byte[] {0}); directories.Add(dirWithAsterisk); questionMarkWildcardShouldMatchCount++; verbatimAsteriskShouldMatchCount++; @@ -63,11 +62,11 @@ namespace Duplicati.UnitTest const string questionMark = "?"; string dirWithQuestionMark = Path.Combine(this.DATAFOLDER, questionMark); // Windows does not support literal question marks in paths. - if (!Platform.IsClientWindows) - { - SystemIO.IO_OS.DirectoryCreate(dirWithQuestionMark); - TestUtils.WriteFile(SystemIO.IO_OS.PathCombine(dirWithQuestionMark, file), new byte[] { 1 }); - directories.Add(dirWithQuestionMark); + if (!Platform.IsClientWindows) + { + SystemIO.IO_OS.DirectoryCreate(dirWithQuestionMark); + TestUtils.WriteFile(SystemIO.IO_OS.PathCombine(dirWithQuestionMark, file), new byte[] { 1 }); + directories.Add(dirWithQuestionMark); questionMarkWildcardShouldMatchCount++; } @@ -75,9 +74,9 @@ namespace Duplicati.UnitTest // for a '?' wildcard can match on const string singleCharacterDir = "X"; string dirWithSingleCharacter = Path.Combine(this.DATAFOLDER, singleCharacterDir); - SystemIO.IO_OS.DirectoryCreate(dirWithSingleCharacter); - TestUtils.WriteFile(SystemIO.IO_OS.PathCombine(dirWithSingleCharacter, file), new byte[] { 2 }); - directories.Add(dirWithSingleCharacter); + SystemIO.IO_OS.DirectoryCreate(dirWithSingleCharacter); + TestUtils.WriteFile(SystemIO.IO_OS.PathCombine(dirWithSingleCharacter, file), new byte[] { 2 }); + directories.Add(dirWithSingleCharacter); questionMarkWildcardShouldMatchCount++; const string dir = "dir"; @@ -103,7 +102,7 @@ namespace Duplicati.UnitTest Assert.AreEqual(0, restoreResults.Errors.Count()); Assert.AreEqual(0, restoreResults.Warnings.Count()); - TestUtils.AssertDirectoryTreesAreEquivalent(this.DATAFOLDER, this.RESTOREFOLDER, true, "Restore"); + TestUtils.AssertDirectoryTreesAreEquivalent(this.DATAFOLDER, this.RESTOREFOLDER, true, "Restore"); // List results using * should return a match for each directory. IListResults listResults = c.List(SystemIO.IO_OS.PathCombine(dirWithAsterisk, file)); @@ -114,11 +113,11 @@ namespace Duplicati.UnitTest listResults = c.List(SystemIO.IO_OS.PathCombine(dirWithQuestionMark, file)); Assert.AreEqual(0, listResults.Errors.Count()); Assert.AreEqual(0, listResults.Warnings.Count()); - // List results using ? should return 3 matches in Linux, - // one for the directory with '*' and one for the directory - // with '?', plus one for directory 'X'; but should return - // 1 matches in Windows just for directory 'X'. - Assert.AreEqual(questionMarkWildcardShouldMatchCount, listResults.Files.Count()); + // List results using ? should return 3 matches in Linux, + // one for the directory with '*' and one for the directory + // with '?', plus one for directory 'X'; but should return + // 1 matches in Windows just for directory 'X'. + Assert.AreEqual(questionMarkWildcardShouldMatchCount, listResults.Files.Count()); } SystemIO.IO_OS.DirectoryDelete(this.RESTOREFOLDER, true); @@ -173,9 +172,9 @@ namespace Duplicati.UnitTest IBackupResults backupResults = c.Backup(new[] {this.DATAFOLDER}, filter); Assert.AreEqual(0, backupResults.Errors.Count()); Assert.AreEqual(0, backupResults.Warnings.Count()); - Assert.AreEqual(verbatimAsteriskShouldMatchCount, backupResults.ExaminedFiles); + Assert.AreEqual(verbatimAsteriskShouldMatchCount, backupResults.ExaminedFiles); } - } + } [Test] [Category("ProblematicPath")] diff --git a/Duplicati/UnitTest/PurgeTesting.cs b/Duplicati/UnitTest/PurgeTesting.cs index a89411fc9..cd0eb7e70 100644 --- a/Duplicati/UnitTest/PurgeTesting.cs +++ b/Duplicati/UnitTest/PurgeTesting.cs @@ -1,4 +1,4 @@ -// Copyright (C) 2024, The Duplicati Team +// Copyright (C) 2024, The Duplicati Team // https://duplicati.com, hello@duplicati.com // // Permission is hereby granted, free of charge, to any person obtaining a @@ -28,7 +28,6 @@ using Duplicati.Library.Interface; using Duplicati.Library.Main; using Duplicati.Library.Utility; using NUnit.Framework; -using Microsoft.AspNetCore.Mvc; namespace Duplicati.UnitTest { diff --git a/Duplicati/UnitTest/RecoveryToolTests.cs b/Duplicati/UnitTest/RecoveryToolTests.cs index f45c166b7..71506763f 100644 --- a/Duplicati/UnitTest/RecoveryToolTests.cs +++ b/Duplicati/UnitTest/RecoveryToolTests.cs @@ -25,7 +25,6 @@ using System.Linq; using Duplicati.Library.Interface; using Duplicati.Library.Main; using NUnit.Framework; -using Microsoft.AspNetCore.Mvc; namespace Duplicati.UnitTest { diff --git a/Duplicati/UnitTest/RepairHandlerTests.cs b/Duplicati/UnitTest/RepairHandlerTests.cs index bba7af190..c3a494845 100644 --- a/Duplicati/UnitTest/RepairHandlerTests.cs +++ b/Duplicati/UnitTest/RepairHandlerTests.cs @@ -28,7 +28,6 @@ using Duplicati.Library.Main; using Duplicati.Library.Main.Database; using Duplicati.Library.SQLiteHelper; using NUnit.Framework; -using Microsoft.AspNetCore.Mvc; namespace Duplicati.UnitTest { diff --git a/Duplicati/UnitTest/RestoreHandlerTests.cs b/Duplicati/UnitTest/RestoreHandlerTests.cs index 3434759b5..ace81d48a 100644 --- a/Duplicati/UnitTest/RestoreHandlerTests.cs +++ b/Duplicati/UnitTest/RestoreHandlerTests.cs @@ -27,7 +27,6 @@ using Duplicati.Library.Common.IO; using Duplicati.Library.Interface; using Duplicati.Library.Main; using NUnit.Framework; -using Microsoft.AspNetCore.Mvc; namespace Duplicati.UnitTest { @@ -93,9 +92,9 @@ namespace Duplicati.UnitTest File.WriteAllBytes(filePath, new byte[] {0}); // Protect access rules on the file. - FileSecurity fileSecurity = File.GetAccessControl(filePath); + FileSecurity fileSecurity = new FileInfo(filePath).GetAccessControl(); fileSecurity.SetAccessRuleProtection(true, true); - File.SetAccessControl(filePath, fileSecurity); + new FileInfo(filePath).SetAccessControl(fileSecurity); Dictionary options = new Dictionary(this.TestOptions); using (Controller c = new Controller("file://" + this.TARGETFOLDER, options, null)) @@ -116,7 +115,7 @@ namespace Duplicati.UnitTest string restoredFilePath = Path.Combine(this.RESTOREFOLDER, "file"); Assert.IsTrue(File.Exists(restoredFilePath)); - FileSecurity restoredFileSecurity = File.GetAccessControl(restoredFilePath); + FileSecurity restoredFileSecurity = new FileInfo(restoredFilePath).GetAccessControl(); Assert.IsFalse(restoredFileSecurity.AreAccessRulesProtected); // Remove the restored file so that the later restore avoids the "Restore completed @@ -136,7 +135,7 @@ namespace Duplicati.UnitTest string restoredFilePath = Path.Combine(this.RESTOREFOLDER, "file"); Assert.IsTrue(File.Exists(restoredFilePath)); - FileSecurity restoredFileSecurity = File.GetAccessControl(restoredFilePath); + FileSecurity restoredFileSecurity = new FileInfo(restoredFilePath).GetAccessControl(); Assert.IsTrue(restoredFileSecurity.AreAccessRulesProtected); } } diff --git a/Duplicati/UnitTest/RunScriptTests.cs b/Duplicati/UnitTest/RunScriptTests.cs index d966aff75..5cf8571dd 100644 --- a/Duplicati/UnitTest/RunScriptTests.cs +++ b/Duplicati/UnitTest/RunScriptTests.cs @@ -1,4 +1,4 @@ -// Copyright (C) 2024, The Duplicati Team +// Copyright (C) 2024, The Duplicati Team // https://duplicati.com, hello@duplicati.com // // Permission is hereby granted, free of charge, to any person obtaining a @@ -27,7 +27,6 @@ using Duplicati.Library.Common; using Duplicati.Library.Interface; using Duplicati.Library.Main; using NUnit.Framework; -using Microsoft.AspNetCore.Mvc; namespace Duplicati.UnitTest { diff --git a/Duplicati/UnitTest/SVNCheckoutsTest.cs b/Duplicati/UnitTest/SVNCheckoutsTest.cs index 3b06669a2..7b583ce55 100644 --- a/Duplicati/UnitTest/SVNCheckoutsTest.cs +++ b/Duplicati/UnitTest/SVNCheckoutsTest.cs @@ -1,23 +1,23 @@ -// Copyright (C) 2024, The Duplicati Team -// https://duplicati.com, hello@duplicati.com -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. +// Copyright (C) 2024, The Duplicati Team +// https://duplicati.com, hello@duplicati.com +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; @@ -27,7 +27,6 @@ using Duplicati.Library.Logging; using Duplicati.Library.Utility; using System.Linq; using Duplicati.Library.Common.IO; -using Microsoft.AspNetCore.Mvc; namespace Duplicati.UnitTest { diff --git a/Duplicati/UnitTest/SymLinkTests.cs b/Duplicati/UnitTest/SymLinkTests.cs index 180fa57fb..b2700d9a5 100755 --- a/Duplicati/UnitTest/SymLinkTests.cs +++ b/Duplicati/UnitTest/SymLinkTests.cs @@ -1,23 +1,23 @@ -// Copyright (C) 2024, The Duplicati Team -// https://duplicati.com, hello@duplicati.com -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. +// Copyright (C) 2024, The Duplicati Team +// https://duplicati.com, hello@duplicati.com +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; using System.Collections.Generic; using System.Linq; @@ -26,7 +26,6 @@ using Duplicati.Library.Interface; using Duplicati.Library.Main; using Duplicati.Library.Snapshots; using NUnit.Framework; -using Microsoft.AspNetCore.Mvc; namespace Duplicati.UnitTest {