diff options
Diffstat (limited to 'Duplicati/Library/IO')
-rw-r--r-- | Duplicati/Library/IO/Duplicati.Library.Common.csproj (renamed from Duplicati/Library/IO/Duplicati.Library.IO.csproj) | 21 | ||||
-rw-r--r-- | Duplicati/Library/IO/IO/DefineDosDevice.cs (renamed from Duplicati/Library/IO/DefineDosDevice.cs) | 2 | ||||
-rw-r--r-- | Duplicati/Library/IO/IO/FileEntry.cs (renamed from Duplicati/Library/IO/FileEntry.cs) | 2 | ||||
-rw-r--r-- | Duplicati/Library/IO/IO/ISystemIO.cs (renamed from Duplicati/Library/IO/ISystemIO.cs) | 2 | ||||
-rw-r--r-- | Duplicati/Library/IO/IO/SystemIO.cs (renamed from Duplicati/Library/IO/SystemIO.cs) | 10 | ||||
-rw-r--r-- | Duplicati/Library/IO/IO/SystemIOLinux.cs (renamed from Duplicati/Library/IO/SystemIOLinux.cs) | 2 | ||||
-rw-r--r-- | Duplicati/Library/IO/IO/SystemIOWindows.cs (renamed from Duplicati/Library/IO/SystemIOWindows.cs) | 3 | ||||
-rw-r--r-- | Duplicati/Library/IO/IO/Util.cs (renamed from Duplicati/Library/IO/Util.cs) | 2 | ||||
-rw-r--r-- | Duplicati/Library/IO/IO/VssBackupComponents.cs (renamed from Duplicati/Library/IO/VssBackupComponents.cs) | 2 | ||||
-rw-r--r-- | Duplicati/Library/IO/Platform/Platform.cs | 32 |
10 files changed, 57 insertions, 21 deletions
diff --git a/Duplicati/Library/IO/Duplicati.Library.IO.csproj b/Duplicati/Library/IO/Duplicati.Library.Common.csproj index a784ae16c..0b8bd0289 100644 --- a/Duplicati/Library/IO/Duplicati.Library.IO.csproj +++ b/Duplicati/Library/IO/Duplicati.Library.Common.csproj @@ -59,14 +59,15 @@ </ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="ISystemIO.cs" />
- <Compile Include="SystemIO.cs" />
- <Compile Include="SystemIOWindows.cs" />
- <Compile Include="SystemIOLinux.cs" />
- <Compile Include="VssBackupComponents.cs" />
- <Compile Include="Util.cs" />
- <Compile Include="DefineDosDevice.cs" />
- <Compile Include="FileEntry.cs" />
+ <Compile Include="Platform\Platform.cs" />
+ <Compile Include="IO\SystemIO.cs" />
+ <Compile Include="IO\SystemIOLinux.cs" />
+ <Compile Include="IO\SystemIOWindows.cs" />
+ <Compile Include="IO\ISystemIO.cs" />
+ <Compile Include="IO\FileEntry.cs" />
+ <Compile Include="IO\VssBackupComponents.cs" />
+ <Compile Include="IO\Util.cs" />
+ <Compile Include="IO\DefineDosDevice.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
@@ -92,5 +93,9 @@ <Name>Duplicati.Library.Interface</Name>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <Folder Include="IO\" />
+ <Folder Include="Platform\" />
+ </ItemGroup>
<Import Project="..\..\..\packages\AlphaVSS.1.4.0\build\net45\AlphaVSS.targets" Condition="Exists('..\..\..\packages\AlphaVSS.1.4.0\build\net45\AlphaVSS.targets')" />
</Project>
diff --git a/Duplicati/Library/IO/DefineDosDevice.cs b/Duplicati/Library/IO/IO/DefineDosDevice.cs index fcd787c52..f6149bc04 100644 --- a/Duplicati/Library/IO/DefineDosDevice.cs +++ b/Duplicati/Library/IO/IO/DefineDosDevice.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Text;
using System.IO;
-namespace Duplicati.Library.IO
+namespace Duplicati.Library.Common.IO
{
/// <summary>
/// Implements a convenient wrapping for mapping a path to a drive letter
diff --git a/Duplicati/Library/IO/FileEntry.cs b/Duplicati/Library/IO/IO/FileEntry.cs index aafeddf0f..689163ba9 100644 --- a/Duplicati/Library/IO/FileEntry.cs +++ b/Duplicati/Library/IO/IO/FileEntry.cs @@ -20,7 +20,7 @@ using System;
using Duplicati.Library.Interface;
-namespace Duplicati.Library.IO
+namespace Duplicati.Library.Common.IO
{
/// <summary>
/// The primary implementation of the file interface
diff --git a/Duplicati/Library/IO/ISystemIO.cs b/Duplicati/Library/IO/IO/ISystemIO.cs index e53d2339f..8fe034b19 100644 --- a/Duplicati/Library/IO/ISystemIO.cs +++ b/Duplicati/Library/IO/IO/ISystemIO.cs @@ -20,7 +20,7 @@ using System.IO; using System.Collections.Generic;
using Duplicati.Library.Interface; -namespace Duplicati.Library.IO
+namespace Duplicati.Library.Common.IO
{
/// <summary>
/// Interface for wrapping System.IO operations.
diff --git a/Duplicati/Library/IO/SystemIO.cs b/Duplicati/Library/IO/IO/SystemIO.cs index e5a6c71ec..0dc1a1d5b 100644 --- a/Duplicati/Library/IO/SystemIO.cs +++ b/Duplicati/Library/IO/IO/SystemIO.cs @@ -15,7 +15,7 @@ // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System; -namespace Duplicati.Library.IO +namespace Duplicati.Library.Common.IO { public static class SystemIO {
@@ -44,11 +44,11 @@ namespace Duplicati.Library.IO }
- public static ISystemIO IO_OS(bool useWindowsIO) + public static ISystemIO IO_OS { - {
- return useWindowsIO ? _IO_WIN : _IO_SYS; - } + get {
+ return Platform.IsClientWindows ? _IO_WIN : _IO_SYS;
+ } }
}
}
\ No newline at end of file diff --git a/Duplicati/Library/IO/SystemIOLinux.cs b/Duplicati/Library/IO/IO/SystemIOLinux.cs index 41586abe3..fecdf5f5f 100644 --- a/Duplicati/Library/IO/SystemIOLinux.cs +++ b/Duplicati/Library/IO/IO/SystemIOLinux.cs @@ -21,7 +21,7 @@ using System.Linq; using System.Collections.Generic;
using Duplicati.Library.Interface; -namespace Duplicati.Library.IO
+namespace Duplicati.Library.Common.IO
{
public struct SystemIOLinux : ISystemIO
{
diff --git a/Duplicati/Library/IO/SystemIOWindows.cs b/Duplicati/Library/IO/IO/SystemIOWindows.cs index 8fd7ee28c..f6d641b64 100644 --- a/Duplicati/Library/IO/SystemIOWindows.cs +++ b/Duplicati/Library/IO/IO/SystemIOWindows.cs @@ -20,11 +20,10 @@ using System.Collections.Generic; using System.Security.AccessControl;
using System.IO;
-using Alphaleonis.Win32.Vss;
using AlphaFS = Alphaleonis.Win32.Filesystem;
using Duplicati.Library.Interface;
-namespace Duplicati.Library.IO
+namespace Duplicati.Library.Common.IO
{
public struct SystemIOWindows : ISystemIO
{
diff --git a/Duplicati/Library/IO/Util.cs b/Duplicati/Library/IO/IO/Util.cs index 52287fcce..879da2609 100644 --- a/Duplicati/Library/IO/Util.cs +++ b/Duplicati/Library/IO/IO/Util.cs @@ -17,7 +17,7 @@ using System; using System.IO; -namespace Duplicati.Library.IO +namespace Duplicati.Library.Common.IO { public static class Util { diff --git a/Duplicati/Library/IO/VssBackupComponents.cs b/Duplicati/Library/IO/IO/VssBackupComponents.cs index 0368310a9..e236aff8c 100644 --- a/Duplicati/Library/IO/VssBackupComponents.cs +++ b/Duplicati/Library/IO/IO/VssBackupComponents.cs @@ -20,7 +20,7 @@ using System.IO; using System.Linq; using Alphaleonis.Win32.Vss;
-namespace Duplicati.Library.IO +namespace Duplicati.Library.Common.IO {
public class WriterMetaData {
diff --git a/Duplicati/Library/IO/Platform/Platform.cs b/Duplicati/Library/IO/Platform/Platform.cs new file mode 100644 index 000000000..47974a1f5 --- /dev/null +++ b/Duplicati/Library/IO/Platform/Platform.cs @@ -0,0 +1,32 @@ +// Copyright (C) 2018, The Duplicati Team
+// http://www.duplicati.com, info@duplicati.com
+//
+// This library is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation; either version 2.1 of the
+// License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System; +namespace Duplicati.Library.Common +{ + public static class Platform + { + /// <value>
+ /// Gets or sets a value indicating if the client is Linux/Unix based
+ /// </value>
+ public static bool IsClientLinux => Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX;
+
+ /// <summary>
+ /// Gets a value indicating if the client is Windows based
+ /// </summary>
+ public static bool IsClientWindows => !IsClientLinux;
+ } +} |