mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 05:05:05 +00:00
feat: Added methods for getting user data paths
This commit is contained in:
@@ -358,6 +358,32 @@ namespace ICD.Common.Utils
|
|||||||
return string.Format("Room{0}Data", roomId);
|
return string.Format("Room{0}Data", roomId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Appends the local path to the user data path.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userName"></param>
|
||||||
|
/// <param name="localPath"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string GetUserDataPath(string userName, params string[] localPath)
|
||||||
|
{
|
||||||
|
if (localPath == null)
|
||||||
|
throw new ArgumentNullException("localPath");
|
||||||
|
|
||||||
|
string local = Join(localPath);
|
||||||
|
string userDataDirectory = GetUserDataDirectory(userName);
|
||||||
|
return Join(ProgramDataPath, userDataDirectory, local);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the directory name of the user data directory for the user with the given name.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userName"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string GetUserDataDirectory(string userName)
|
||||||
|
{
|
||||||
|
return string.Format("User{0}Data", StringUtils.RemoveWhitespace(userName));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Appends the local path to the web server path.
|
/// Appends the local path to the web server path.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user