getting some interface to fs

This commit is contained in:
2019-08-25 01:47:46 +01:00
parent a249b65a37
commit b17ba1faba
11 changed files with 144 additions and 36 deletions

View File

@ -47,7 +47,6 @@ namespace Yavsc.Helpers
public static UserDirectoryInfo GetUserFiles(string userName, string subdir)
{
UserDirectoryInfo di = new UserDirectoryInfo(UserFilesDirName, userName, subdir);
return di;
}

View File

@ -28,7 +28,7 @@ namespace Yavsc.ViewModels.UserFiles
if (string.IsNullOrWhiteSpace(username))
throw new NotSupportedException("No user name, no user dir.");
UserName = username;
var finalPath = username;
var finalPath = path == null ? username : Path.Combine(username, path);
if (!finalPath.IsValidYavscPath())
throw new InvalidOperationException(
$"File name contains invalid chars ({finalPath})");