public TemporaryFile DownloadFile() { var temp = new TemporaryFile(); _pendingChange.DownloadShelvedFile(temp); _contentLength = new FileInfo(temp).Length; return(temp); }
public Stream DownloadFile() { string temp = Path.GetTempFileName(); _pendingChange.DownloadShelvedFile(temp); var stream = new TemporaryFileStream(temp); _contentLength = stream.Length; return(stream); }
/// <summary> /// Compares the contents of two given files. /// </summary> /// <param name="firstPendingChange">The first pending change file.</param> /// <param name="secondPendingChange">The second pending change file</param> /// <returns>True if the file contents are same. False otherwise.</returns> private static bool AreFilesInPendingChangesSame(PendingChange firstPendingChange, PendingChange secondPendingChange) { if (firstPendingChange != null && secondPendingChange != null && firstPendingChange.ChangeType != ChangeType.Delete && secondPendingChange.ChangeType != ChangeType.Delete) { string pendingChangeFileName = Path.GetTempFileName(); firstPendingChange.DownloadShelvedFile(pendingChangeFileName); string matchingFileName = Path.GetTempFileName(); secondPendingChange.DownloadShelvedFile(matchingFileName); return(FileCompare(pendingChangeFileName, matchingFileName)); } return(false); }
/// <summary> /// Downloads the shelved file. /// </summary> /// <param name="filePathToDownloadFileTo">The file path to download file to.</param> public void DownloadShelvedFile(string filePathToDownloadFileTo) { _pendingChange.DownloadShelvedFile(filePathToDownloadFileTo); }
public void Download(string destFolder) => _pendingChange.DownloadShelvedFile($"{destFolder}\\{Folder}\\{Name}");