Skip to content

Instantly share code, notes, and snippets.

@vmandic
Last active October 19, 2018 19:59
Show Gist options
  • Save vmandic/2cbedc057750d4aa1930a8ba3b9c0602 to your computer and use it in GitHub Desktop.
Save vmandic/2cbedc057750d4aa1930a8ba3b9c0602 to your computer and use it in GitHub Desktop.
meds-processor, p2, s9
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