diff --git a/src/Dynamicweb.DataIntegration.Providers.ExcelProvider.csproj b/src/Dynamicweb.DataIntegration.Providers.ExcelProvider.csproj index 308f7dd..3127496 100644 --- a/src/Dynamicweb.DataIntegration.Providers.ExcelProvider.csproj +++ b/src/Dynamicweb.DataIntegration.Providers.ExcelProvider.csproj @@ -1,6 +1,6 @@  - 10.6.2 + 10.6.3 1.0.0 Excel Provider Excel Provider diff --git a/src/ExcelProvider.cs b/src/ExcelProvider.cs index 98b21f6..c9648b6 100644 --- a/src/ExcelProvider.cs +++ b/src/ExcelProvider.cs @@ -1,4 +1,5 @@ using Dynamicweb.Core; +using Dynamicweb.Core.Helpers; using Dynamicweb.DataIntegration.Integration; using Dynamicweb.DataIntegration.Integration.Interfaces; using Dynamicweb.Extensibility.AddIns; @@ -57,22 +58,16 @@ public override Schema GetOriginalDestinationSchema() public override Schema GetOriginalSourceSchema() { - Schema result = new Schema(); - - string currentPath = SourceFile; - if (!string.IsNullOrEmpty(workingDirectory)) - { - currentPath = workingDirectory.CombinePaths(SourceFile); - } + Schema result = new Schema(); var sourceFilePath = GetSourceFilePath(); if (File.Exists(sourceFilePath)) { try { - if (currentPath.EndsWith(".xls", StringComparison.OrdinalIgnoreCase) || - currentPath.EndsWith(".xlsx", StringComparison.OrdinalIgnoreCase) || - currentPath.EndsWith(".xlsm", StringComparison.OrdinalIgnoreCase)) + if (SourceFile.EndsWith(".xls", StringComparison.OrdinalIgnoreCase) || + SourceFile.EndsWith(".xlsx", StringComparison.OrdinalIgnoreCase) || + SourceFile.EndsWith(".xlsm", StringComparison.OrdinalIgnoreCase)) { Dictionary excelReaders = new Dictionary { @@ -116,11 +111,11 @@ private string GetSourceFilePath() { if (SourceFile.StartsWith("..")) { - srcFilePath = (this.WorkingDirectory.CombinePaths(SourceFile.TrimStart(new char[] { '.' })).Replace("\\", "/")); + srcFilePath = WorkingDirectory.CombinePaths(SourceFile.TrimStart(new char[] { '.' })).Replace("\\", "/"); } else { - srcFilePath = this.WorkingDirectory.CombinePaths(FilesFolderName, SourceFile).Replace("\\", "/"); + srcFilePath = SystemInformation.MapPath(FilePathHelper.GetRelativePath(SourceFile, "/Files")); } } return srcFilePath;