public void DownloadFileFromCDN(string fileName) { if (BibaUtility.CheckForInternetConnection()) { RetrieveAndWriteData(BibaContentConstants.GetRelativePath(fileName), BibaContentConstants.GetPersistedPath(fileName)); } }
public void DownloadFilesFromCDN() { if (BibaUtility.CheckForInternetConnection()) { ReloadContent(); RetrieveAndWriteData(BibaContentConstants.GetRelativePath(BibaContentConstants.MANIFEST_FILENAME), BibaContentConstants.GetPersistedPath(BibaContentConstants.MANIFEST_FILENAME), ManifestRetrieved); } }
void ManifestRetrieved(string remoteManifestString) { if (string.IsNullOrEmpty(remoteManifestString)) { return; } var remoteManifest = DataService.ReadFromDisk <BibaManifest>(BibaContentConstants.GetPersistedPath(BibaContentConstants.MANIFEST_FILENAME)); if (remoteManifest != null && remoteManifest.TimeStamp > _localManifest.TimeStamp) { foreach (var remoteLine in remoteManifest.Lines) { var localLine = _localManifest.Lines.Find(line => line.FileName == remoteLine.FileName); if ((localLine == null || localLine.TimeStamp < remoteLine.TimeStamp) && !remoteLine.OptionalDownload) { RetrieveAndWriteData(BibaContentConstants.GetRelativePath(remoteLine.FileName), BibaContentConstants.GetPersistedPath(remoteLine.FileName)); } } _localManifest = remoteManifest; } }