Skip to content

Commit

Permalink
spacing, add note to issue template
Browse files Browse the repository at this point in the history
  • Loading branch information
robinrodricks committed Nov 9, 2017
1 parent 7915a37 commit 6111381
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
38 changes: 19 additions & 19 deletions FluentFTP/Client/FtpClient_HighLevel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ public async Task<bool> UploadFileAsync(string localPath, string remotePath, Ftp
}
#endif

private bool UploadFileFromFile(string localPath, string remotePath, bool createRemoteDir, FtpExists existsMode, bool fileExists, bool fileExistsKnown, FtpVerify verifyOptions, IProgress<double> progress) {
private bool UploadFileFromFile(string localPath, string remotePath, bool createRemoteDir, FtpExists existsMode, bool fileExists, bool fileExistsKnown, FtpVerify verifyOptions, IProgress<double> progress) {

// If retries are allowed set the retry counter to the allowed count
int attemptsLeft = verifyOptions.HasFlag(FtpVerify.Retry) ? m_retryAttempts : 1;
Expand Down Expand Up @@ -1608,20 +1608,20 @@ private async Task<bool> DownloadFileToFileAsync(string localPath, string remote
return downloadSuccess && verified;
}
#endif
#endregion
#endregion

#region Download Bytes/Stream
#region Download Bytes/Stream

/// <summary>
/// Downloads the specified file into the specified stream.
/// High-level API that takes care of various edge cases internally.
/// Supports very large files since it downloads data in chunks.
/// </summary>
/// <param name="outStream">The stream that the file will be written to. Provide a new MemoryStream if you only want to read the file into memory.</param>
/// <param name="remotePath">The full or relative path to the file on the server</param>
/// <param name="progress">Provide an implementation of IProgress to track download progress. The value provided is in the range 0 to 100, indicating the percentage of the file transferred. If the progress is indeterminate, -1 is sent.</param>
/// <returns>If true then the file was downloaded, false otherwise.</returns>
public bool Download(Stream outStream, string remotePath, IProgress<double> progress = null) {
/// <summary>
/// Downloads the specified file into the specified stream.
/// High-level API that takes care of various edge cases internally.
/// Supports very large files since it downloads data in chunks.
/// </summary>
/// <param name="outStream">The stream that the file will be written to. Provide a new MemoryStream if you only want to read the file into memory.</param>
/// <param name="remotePath">The full or relative path to the file on the server</param>
/// <param name="progress">Provide an implementation of IProgress to track download progress. The value provided is in the range 0 to 100, indicating the percentage of the file transferred. If the progress is indeterminate, -1 is sent.</param>
/// <returns>If true then the file was downloaded, false otherwise.</returns>
public bool Download(Stream outStream, string remotePath, IProgress<double> progress = null) {

// verify args
if (outStream == null)
Expand Down Expand Up @@ -1763,20 +1763,20 @@ private bool DownloadFileInternal(string remotePath, Stream outStream, IProgress
Stream downStream = null;

try {

// get file size if downloading in binary mode (in ASCII mode we read until EOF)
long fileLen = 0;
if (DownloadDataType == FtpDataType.Binary){
if (DownloadDataType == FtpDataType.Binary) {
fileLen = GetFileSize(remotePath);
}

// open the file for reading
downStream = OpenRead(remotePath, DownloadDataType, 0, fileLen > 0);

// if the server has not provided a length for this file
// we read until EOF instead of reading a specific number of bytes
bool readToEnd = (fileLen <= 0);

// loop till entire file downloaded
byte[] buffer = new byte[TransferChunkSize];
long offset = 0;
Expand All @@ -1787,7 +1787,7 @@ private bool DownloadFileInternal(string remotePath, Stream outStream, IProgress
// read a chunk of bytes from the FTP stream
int readBytes = 1;
while ((readBytes = downStream.Read(buffer, 0, buffer.Length)) > 0) {

// write chunk to output stream
outStream.Write(buffer, 0, readBytes);
offset += readBytes;
Expand Down
2 changes: 1 addition & 1 deletion ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ See this link for steps : https://github.com/robinrodricks/FluentFTP#faq_trace
-->

```
<paste logs here>
<paste logs here but DO NOT delete the lines above and below this line>
```

0 comments on commit 6111381

Please sign in to comment.