Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
abparticular committed May 30, 2024
1 parent da0d0c5 commit 17a808c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/NServiceBus.Core/DataBus/FileShareDataBusImplementation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@ namespace NServiceBus;
using Logging;

class FileShareDataBusImplementation : IDataBus
{
{
// to account for mixed platforms ie windows -> linux or linux -> windows
internal class PathNormalizer
{
{
// Example keys
// string key1 = "foldername/filename";
// string key2 = "foldername\\filename";

// Normalize the keys
// string normalizedKey1 = NormalizePath(key1);
// string normalizedKey2 = NormalizePath(key2);

// Output the normalized keys
// Console.WriteLine(normalizedKey1); // Output will be "foldername\filename" on Windows, "foldername/filename" on Unix-based systems
// Console.WriteLine(normalizedKey2); // Output will be "foldername\filename" on Windows, "foldername/filename" on Unix-based systems
internal static string NormalizePath(string key)
{
// Determine the directory separator for the current platform
char separator = Path.DirectorySeparatorChar;
char separator = Path.DirectorySeparatorChar;
// Replace any forward slashes (common in URIs) and backward slashes with the platform-specific separator
string normalizedPath = key.Replace('/', separator).Replace('\\', separator);

return normalizedPath;
}
}
}


Expand Down

0 comments on commit 17a808c

Please sign in to comment.