public void GetLatestReplaceFile(FileDataLocation fileLocation, DateTime fileTime, bool?exists, bool?checkedOut) { if (exists == null) { exists = fileSystem.Exists(fileLocation.LocalPath); } fileSystem.WriteAllBytes(fileLocation.LocalPath, fileLocation.Data); if (fileTime != DateTime.MinValue) { fileSystem.SetLastWriteTimeUtc(fileLocation.LocalPath, fileTime); } if (!(checkedOut.HasValue && checkedOut.Value)) { fileSystem.SetAttributes(fileLocation.LocalPath, FileAttributes.ReadOnly); } }
public void GetLatestReplaceFile(FileDataLocation fileLocation, DateTime fileTime, bool? exists, bool? checkedOut) { if (exists == null) exists = fileSystem.Exists(fileLocation.LocalPath); fileSystem.WriteAllBytes(fileLocation.LocalPath, fileLocation.Data); if (fileTime != DateTime.MinValue) { fileSystem.SetLastWriteTimeUtc(fileLocation.LocalPath, fileTime); } if (!(checkedOut.HasValue && checkedOut.Value)) { fileSystem.SetAttributes(fileLocation.LocalPath, FileAttributes.ReadOnly); } }