Last active
October 19, 2018 19:59
-
-
Save vmandic/2cbedc057750d4aa1930a8ba3b9c0602 to your computer and use it in GitHub Desktop.
meds-processor, p2, s9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HzzoMedsDownloadDto | |
{ | |
private readonly string _rootLocation; | |
public HzzoMedsDownloadDto(string href, string validFrom, string rootLocation) | |
{ | |
this.Href = href; | |
this.ValidFrom = DateTime.Parse(validFrom); | |
this._rootLocation = rootLocation; | |
} | |
public string FilePath => | |
Path.Combine(_rootLocation, FileName); | |
public bool IsAlreadyDownloaded => | |
File.Exists(FilePath); | |
public string FileName => | |
ValidFrom.ToString("yyyy-MM-dd_") + | |
(Href.Split('/').LastOrDefault() ?? Href.Replace("/", "_").Replace(":", "_")).TrimEnd(); | |
public string Href { get; internal set; } | |
public DateTime ValidFrom { get; private set; } | |
public Stream DocumentStream { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment