mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-15 00:15:15 +08:00
25 lines
523 B
C#
25 lines
523 B
C#
using System;
|
|
using System.IO;
|
|
|
|
namespace MQTTnet.Server.Configuration
|
|
{
|
|
public static class PathHelper
|
|
{
|
|
public static string ExpandPath(string path)
|
|
{
|
|
if (path == null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
var uri = new Uri(path, UriKind.RelativeOrAbsolute);
|
|
if (!uri.IsAbsoluteUri)
|
|
{
|
|
return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, path);
|
|
}
|
|
|
|
return path;
|
|
}
|
|
}
|
|
}
|