public static void SetLastModifiedDate(IDocument remoteDocument, string filepath, Dictionary<string, string[]> metadata)
{
try
{
if (remoteDocument.LastModificationDate != null)
{
File.SetLastWriteTimeUtc(filepath, (DateTime)remoteDocument.LastModificationDate);
}
else
{
string[] cmisModDate;
if (metadata.TryGetValue("cmis:lastModificationDate", out cmisModDate) && cmisModDate.Length == 3)
{
DateTime modDate = DateTime.Parse(cmisModDate[2]);
File.SetLastWriteTimeUtc(filepath, modDate);
}
}
}
catch (Exception e)
{
Logger.Debug(string.Format("Failed to set last modified date for the local file: {0}", filepath), e);
}
}