public static string GetFullPath <T1, T2>(string fileStorageName, FilePathScheme scheme, T1 paramPath, T2 paramFile, string paramExt) { string result = GetRootPath(fileStorageName, scheme); result = Path.Combine(result, GetRelativePath <T1>(fileStorageName, paramPath)); result = Path.Combine(result, GetFileName <T2>(fileStorageName, paramFile, paramExt)); return(new Uri(result).ToString()); }
/// <summary> /// /// </summary> /// <param name="rootID">文件根编号</param> /// <param name="scheme">文件存储类型</param> /// <returns></returns> public static string GetRootPath(int rootID, FilePathScheme scheme) { var fileRoot = FileManagementConfig.FileRoots.FirstOrDefault(a => a.ID == rootID); if (fileRoot != null) { return(fileRoot.GetPath(scheme)); } return(""); }
public string GetPath(FilePathScheme scheme) { switch (scheme) { case FilePathScheme.Ftp: return(FtpPath); case FilePathScheme.Http: return(HttpPath); case FilePathScheme.MMS: return(MMSPath); case FilePathScheme.Physical: return(PhysicalPath); default: return(""); } }
/// <summary> /// 返回文件根路径 /// </summary> /// <param name="fileStorageName">文件存储名称</param> /// <param name="scheme">文件存储类型</param> /// <returns></returns> public static string GetRootPath(string fileStorageName, FilePathScheme scheme) { return(GetRootPath(GetRootID(fileStorageName), scheme)); }