Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorverhoek <30193551+verhoek@users.noreply.github.com>2018-10-25 17:52:19 +0300
committerverhoek <30193551+verhoek@users.noreply.github.com>2018-10-25 18:02:35 +0300
commita3cc49566df59d982f1d32879104fc365a7647f7 (patch)
tree9d33114724aaaeab873df1990d9d20c8da6d7ab5 /Duplicati
parent7872018bbd573ec360d59302909e1478b82f7606 (diff)
Added additional wrappers for alphaFS implementations.
Diffstat (limited to 'Duplicati')
-rw-r--r--Duplicati/Library/Snapshots/ISystemIO.cs3
-rw-r--r--Duplicati/Library/Snapshots/NoSnapshotWindows.cs5
-rw-r--r--Duplicati/Library/Snapshots/SystemIOLinux.cs18
-rw-r--r--Duplicati/Library/Snapshots/SystemIOWindows.cs15
-rw-r--r--Duplicati/Library/Snapshots/USNJournal.cs2
-rw-r--r--Duplicati/Library/Snapshots/WindowsSnapshot.cs18
6 files changed, 45 insertions, 16 deletions
diff --git a/Duplicati/Library/Snapshots/ISystemIO.cs b/Duplicati/Library/Snapshots/ISystemIO.cs
index 1dff9e991..9740034d8 100644
--- a/Duplicati/Library/Snapshots/ISystemIO.cs
+++ b/Duplicati/Library/Snapshots/ISystemIO.cs
@@ -58,6 +58,9 @@ namespace Duplicati.Library.Snapshots
string PathCombine(string path1, string path2);
string GetPathRoot(string path);
string[] GetDirectories(string path);
+ string[] GetFiles(string path);
+ DateTime GetCreationTimeUtc(string path);
+ DateTime GetLastWriteTimeUtc(string path);
IEnumerable<string> EnumerateFileSystemEntries(string path);
void SetMetadata(string path, Dictionary<string, string> metdata, bool restorePermissions);
diff --git a/Duplicati/Library/Snapshots/NoSnapshotWindows.cs b/Duplicati/Library/Snapshots/NoSnapshotWindows.cs
index 34f7f1967..6646f3178 100644
--- a/Duplicati/Library/Snapshots/NoSnapshotWindows.cs
+++ b/Duplicati/Library/Snapshots/NoSnapshotWindows.cs
@@ -17,7 +17,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
using System.Collections.Generic;
-using Alphaleonis.Win32.Filesystem;
namespace Duplicati.Library.Snapshots
{
@@ -99,7 +98,7 @@ namespace Duplicati.Library.Snapshots
try { return base.ListFiles(localFolderPath); }
catch (System.IO.PathTooLongException) { }
- string[] tmp = Directory.GetFiles(SystemIOWindows.PrefixWithUNC(localFolderPath));
+ string[] tmp = IO_WIN.GetFiles(SystemIOWindows.PrefixWithUNC(localFolderPath));
string[] res = new string[tmp.Length];
for(int i = 0; i < tmp.Length; i++)
res[i] = SystemIOWindows.StripUNCPrefix(tmp[i]);
@@ -119,7 +118,7 @@ namespace Duplicati.Library.Snapshots
try { return base.ListFolders(localFolderPath); }
catch (System.IO.PathTooLongException) { }
- string[] tmp = Directory.GetDirectories(SystemIOWindows.PrefixWithUNC(localFolderPath));
+ string[] tmp = IO_WIN.GetDirectories(SystemIOWindows.PrefixWithUNC(localFolderPath));
string[] res = new string[tmp.Length];
for (int i = 0; i < tmp.Length; i++)
res[i] = SystemIOWindows.StripUNCPrefix(tmp[i]);
diff --git a/Duplicati/Library/Snapshots/SystemIOLinux.cs b/Duplicati/Library/Snapshots/SystemIOLinux.cs
index d4d7f2d87..2e7eaca6a 100644
--- a/Duplicati/Library/Snapshots/SystemIOLinux.cs
+++ b/Duplicati/Library/Snapshots/SystemIOLinux.cs
@@ -256,8 +256,22 @@ namespace Duplicati.Library.Snapshots
public string[] GetDirectories(string path)
{
return Directory.GetDirectories(path);
- }
- }
+ }
+
+ public string[] GetFiles(string path)
+ {
+ return Directory.GetFiles(path);
+ }
+
+ public DateTime GetCreationTimeUtc(string path)
+ {
+ return File.GetCreationTimeUtc(path);
+ }
+ public DateTime GetLastWriteTimeUtc(string path)
+ {
+ return File.GetLastWriteTimeUtc(path);
+ }
+ }
}
diff --git a/Duplicati/Library/Snapshots/SystemIOWindows.cs b/Duplicati/Library/Snapshots/SystemIOWindows.cs
index 07f2cd4c1..07e718bec 100644
--- a/Duplicati/Library/Snapshots/SystemIOWindows.cs
+++ b/Duplicati/Library/Snapshots/SystemIOWindows.cs
@@ -622,6 +622,21 @@ namespace Duplicati.Library.Snapshots
return AlphaFS.Directory.GetDirectories(path);
}
+ public string[] GetFiles(string path)
+ {
+ return AlphaFS.Directory.GetFiles(path);
+ }
+
+ public DateTime GetCreationTimeUtc(string path)
+ {
+ return AlphaFS.File.GetCreationTimeUtc(path);
+ }
+
+ public DateTime GetLastWriteTimeUtc(string path)
+ {
+ return AlphaFS.File.GetLastWriteTimeUtc(path);
+ }
+
public static IVssBackupComponents CreateVssBackupComponents()
{
// Substitute for calling VssUtils.LoadImplementation(), as we have the dlls outside the GAC
diff --git a/Duplicati/Library/Snapshots/USNJournal.cs b/Duplicati/Library/Snapshots/USNJournal.cs
index 6f471c914..3b6a71c54 100644
--- a/Duplicati/Library/Snapshots/USNJournal.cs
+++ b/Duplicati/Library/Snapshots/USNJournal.cs
@@ -498,7 +498,7 @@ namespace Duplicati.Library.Snapshots
var path = m_volume;
foreach (var r in pathList)
{
- path = System.IO.Path.Combine(path, r.FileName);
+ path = IO_WIN.PathCombine(path, r.FileName);
}
if (rec.UsnRecord.FileAttributes.HasFlag(Win32USN.FileAttributes.Directory))
diff --git a/Duplicati/Library/Snapshots/WindowsSnapshot.cs b/Duplicati/Library/Snapshots/WindowsSnapshot.cs
index c8b55f0ec..2f63c2e29 100644
--- a/Duplicati/Library/Snapshots/WindowsSnapshot.cs
+++ b/Duplicati/Library/Snapshots/WindowsSnapshot.cs
@@ -24,7 +24,6 @@ using System.IO;
using System.Linq;
using Alphaleonis.Win32.Vss;
-using AlphaFS = Alphaleonis.Win32.Filesystem;
namespace Duplicati.Library.Snapshots
{
@@ -150,7 +149,6 @@ namespace Duplicati.Library.Snapshots
m_volumeReverseMap = m_volumeMap.ToDictionary(x => x.Value, x => x.Key);
-
//If we should map the drives, we do that now and update the volumeMap
if (Utility.Utility.ParseBoolOption(options, "vss-use-mapping"))
{
@@ -204,7 +202,7 @@ namespace Duplicati.Library.Snapshots
if (SystemIOWindows.IsPathTooLong(spath))
{
- try { tmp = AlphaFS.Directory.GetDirectories(spath); }
+ try { tmp = IO_WIN.GetDirectories(spath); }
catch (PathTooLongException) { }
catch (DirectoryNotFoundException) { }
}
@@ -217,7 +215,7 @@ namespace Duplicati.Library.Snapshots
if (tmp == null)
{
spath = SystemIOWindows.PrefixWithUNC(spath);
- tmp = AlphaFS.Directory.GetDirectories(spath);
+ tmp = IO_WIN.GetDirectories(spath);
}
volumePath = SystemIOWindows.PrefixWithUNC(volumePath);
@@ -239,7 +237,7 @@ namespace Duplicati.Library.Snapshots
/// <returns>A list of non-shadow paths</returns>
protected override string[] ListFiles(string localFolderPath)
{
- var root = Utility.Utility.AppendDirSeparator(AlphaFS.Path.GetPathRoot(localFolderPath));
+ var root = Utility.Utility.AppendDirSeparator(IO_WIN.GetPathRoot(localFolderPath));
var volumePath = Utility.Utility.AppendDirSeparator(ConvertToSnapshotPath(root));
string[] tmp = null;
@@ -247,7 +245,7 @@ namespace Duplicati.Library.Snapshots
if (SystemIOWindows.IsPathTooLong(spath))
{
- try { tmp = AlphaFS.Directory.GetFiles(spath); }
+ try { tmp = IO_WIN.GetFiles(spath); }
catch (PathTooLongException) { }
catch (DirectoryNotFoundException) { }
}
@@ -260,7 +258,7 @@ namespace Duplicati.Library.Snapshots
if (tmp == null)
{
spath = SystemIOWindows.PrefixWithUNC(spath);
- tmp = AlphaFS.Directory.GetFiles(spath);
+ tmp = IO_WIN.GetFiles(spath);
}
volumePath = SystemIOWindows.PrefixWithUNC(volumePath);
@@ -293,7 +291,7 @@ namespace Duplicati.Library.Snapshots
catch (PathTooLongException) { }
}
- return AlphaFS.File.GetLastWriteTimeUtc(SystemIOWindows.PrefixWithUNC(spath));
+ return IO_WIN.GetLastWriteTimeUtc(SystemIOWindows.PrefixWithUNC(spath));
}
/// <summary>
@@ -313,7 +311,7 @@ namespace Duplicati.Library.Snapshots
catch (PathTooLongException) { }
}
- return AlphaFS.File.GetCreationTimeUtc(SystemIOWindows.PrefixWithUNC(spath));
+ return IO_WIN.GetCreationTimeUtc(SystemIOWindows.PrefixWithUNC(spath));
}
/// <summary>
@@ -402,7 +400,7 @@ namespace Duplicati.Library.Snapshots
if (!Path.IsPathRooted(localPath))
throw new InvalidOperationException();
- var root = AlphaFS.Path.GetPathRoot(localPath);
+ var root = IO_WIN.GetPathRoot(localPath);
if (!m_volumeMap.TryGetValue(root, out var volumePath))
throw new InvalidOperationException();