public StaticFile( string fullPath, DataProviderContext context, string storeId, string providerRoot) { string websitePath = PathUtil.GetWebsitePath(fullPath); string providerRelativePath = websitePath.Substring(providerRoot.Length - 1); Id = CalculateId(providerRelativePath); DownloadUrl = websitePath; FileName = Path.GetFileName(providerRelativePath); FolderPath = Path.GetDirectoryName(providerRelativePath).Replace("\\","/"); StoreId = storeId; DataSourceId = context.CreateDataSourceId( new MediaDataId { Id = this.Id, MediaType = MediaElementType.File }, typeof(IMediaFile) ); CreationTime = DateTime.MinValue; LastWriteTime = DateTime.MinValue; Length = 0; }
public StaticFolder(string fullPath, DataProviderContext context, string storeId, string providerRoot) { string websitePath = PathUtil.GetWebsitePath(fullPath); string providerRelativePath = websitePath.Substring(providerRoot.Length - 1); Id = CalculateId(providerRelativePath); StoreId = storeId; DataSourceId = context.CreateDataSourceId(new MediaDataId { Id = this.Id, MediaType = MediaElementType.Folder }, typeof(IMediaFileFolder)); Description = ""; Title = System.IO.Path.GetFileName(providerRelativePath); StoreId = storeId; Path = providerRelativePath; KeyPath = storeId + ":" + Id; CompositePath = storeId + ":" + providerRelativePath; }