@@ -240,13 +240,12 @@ internal ScpClient(ConnectionInfo connectionInfo, bool ownsConnectionInfo, IServ
240
240
/// </summary>
241
241
/// <param name="source">The <see cref="Stream"/> to upload.</param>
242
242
/// <param name="path">A relative or absolute path for the remote file.</param>
243
- /// <param name="notifyOnEmptyFile">Should the <see cref="Uploading"/> event be raised when the file is empty?</param>
244
243
/// <exception cref="ArgumentNullException"><paramref name="path" /> is <see langword="null"/>.</exception>
245
244
/// <exception cref="ArgumentException"><paramref name="path"/> is a zero-length <see cref="string"/>.</exception>
246
245
/// <exception cref="ScpException">A directory with the specified path exists on the remote host.</exception>
247
246
/// <exception cref="SshException">The secure copy execution request was rejected by the server.</exception>
248
247
/// <exception cref="SshConnectionException">Client is not connected.</exception>
249
- public void Upload ( Stream source , string path , bool notifyOnEmptyFile = false )
248
+ public void Upload ( Stream source , string path )
250
249
{
251
250
if ( Session is null )
252
251
{
@@ -272,7 +271,7 @@ public void Upload(Stream source, string path, bool notifyOnEmptyFile=false)
272
271
CheckReturnCode ( input ) ;
273
272
274
273
UploadFileModeAndName ( channel , input , source . Length , posixPath . File ) ;
275
- UploadFileContent ( channel , input , source , posixPath . File , notifyOnEmptyFile ) ;
274
+ UploadFileContent ( channel , input , source , posixPath . File ) ;
276
275
}
277
276
}
278
277
@@ -281,14 +280,13 @@ public void Upload(Stream source, string path, bool notifyOnEmptyFile=false)
281
280
/// </summary>
282
281
/// <param name="fileInfo">The file system info.</param>
283
282
/// <param name="path">A relative or absolute path for the remote file.</param>
284
- /// <param name="notifyOnEmptyFile">Should the <see cref="Uploading"/> event be raised when the file is empty?</param>
285
283
/// <exception cref="ArgumentNullException"><paramref name="fileInfo" /> is <see langword="null"/>.</exception>
286
284
/// <exception cref="ArgumentNullException"><paramref name="path" /> is <see langword="null"/>.</exception>
287
285
/// <exception cref="ArgumentException"><paramref name="path"/> is a zero-length <see cref="string"/>.</exception>
288
286
/// <exception cref="ScpException">A directory with the specified path exists on the remote host.</exception>
289
287
/// <exception cref="SshException">The secure copy execution request was rejected by the server.</exception>
290
288
/// <exception cref="SshConnectionException">Client is not connected.</exception>
291
- public void Upload ( FileInfo fileInfo , string path , bool notifyOnEmptyFile = false )
289
+ public void Upload ( FileInfo fileInfo , string path )
292
290
{
293
291
ThrowHelper . ThrowIfNull ( fileInfo ) ;
294
292
@@ -319,7 +317,7 @@ public void Upload(FileInfo fileInfo, string path, bool notifyOnEmptyFile=false)
319
317
{
320
318
UploadTimes ( channel , input , fileInfo ) ;
321
319
UploadFileModeAndName ( channel , input , source . Length , posixPath . File ) ;
322
- UploadFileContent ( channel , input , source , fileInfo . Name , notifyOnEmptyFile ) ;
320
+ UploadFileContent ( channel , input , source , fileInfo . Name ) ;
323
321
}
324
322
}
325
323
}
@@ -329,14 +327,13 @@ public void Upload(FileInfo fileInfo, string path, bool notifyOnEmptyFile=false)
329
327
/// </summary>
330
328
/// <param name="directoryInfo">The directory info.</param>
331
329
/// <param name="path">A relative or absolute path for the remote directory.</param>
332
- /// <param name="notifyOnEmptyFile">Should the <see cref="Uploading"/> event be raised when the file is empty?</param>
333
330
/// <exception cref="ArgumentNullException"><paramref name="directoryInfo"/> is <see langword="null"/>.</exception>
334
331
/// <exception cref="ArgumentNullException"><paramref name="path"/> is <see langword="null"/>.</exception>
335
332
/// <exception cref="ArgumentException"><paramref name="path"/> is a zero-length string.</exception>
336
333
/// <exception cref="ScpException"><paramref name="path"/> does not exist on the remote host, is not a directory or the user does not have the required permission.</exception>
337
334
/// <exception cref="SshException">The secure copy execution request was rejected by the server.</exception>
338
335
/// <exception cref="SshConnectionException">Client is not connected.</exception>
339
- public void Upload ( DirectoryInfo directoryInfo , string path , bool notifyOnEmptyFile = false )
336
+ public void Upload ( DirectoryInfo directoryInfo , string path )
340
337
{
341
338
ThrowHelper . ThrowIfNull ( directoryInfo ) ;
342
339
ThrowHelper . ThrowIfNullOrEmpty ( path ) ;
@@ -365,7 +362,7 @@ public void Upload(DirectoryInfo directoryInfo, string path, bool notifyOnEmptyF
365
362
366
363
CheckReturnCode ( input ) ;
367
364
368
- UploadDirectoryContent ( channel , input , directoryInfo , notifyOnEmptyFile ) ;
365
+ UploadDirectoryContent ( channel , input , directoryInfo ) ;
369
366
}
370
367
}
371
368
@@ -559,11 +556,10 @@ private void UploadFileModeAndName(IChannelSession channel, Stream input, long f
559
556
/// <param name="input">A <see cref="Stream"/> from which any feedback from the server can be read.</param>
560
557
/// <param name="source">The content to upload.</param>
561
558
/// <param name="remoteFileName">The name of the remote file, without path, to which the content is uploaded.</param>
562
- /// <param name="notifyOnEmptyFile">Should the <see cref="Uploading"/> event be raised when the file is empty?</param>
563
559
/// <remarks>
564
560
/// <paramref name="remoteFileName"/> is only used for raising the <see cref="Uploading"/> event.
565
561
/// </remarks>
566
- private void UploadFileContent ( IChannelSession channel , Stream input , Stream source , string remoteFileName , bool notifyOnEmptyFile )
562
+ private void UploadFileContent ( IChannelSession channel , Stream input , Stream source , string remoteFileName )
567
563
{
568
564
var totalLength = source . Length ;
569
565
var buffer = new byte [ BufferSize ] ;
@@ -583,7 +579,7 @@ private void UploadFileContent(IChannelSession channel, Stream input, Stream sou
583
579
read = source . Read ( buffer , 0 , buffer . Length ) ;
584
580
}
585
581
586
- if ( totalLength == 0 && totalRead == 0 && notifyOnEmptyFile )
582
+ if ( totalLength == 0 && totalRead == 0 )
587
583
{
588
584
RaiseUploadingEvent ( remoteFileName , totalLength , totalRead ) ;
589
585
}
@@ -696,8 +692,7 @@ private void UploadTimes(IChannelSession channel, Stream input, FileSystemInfo f
696
692
/// <param name="channel">The channel to perform the upload in.</param>
697
693
/// <param name="input">A <see cref="Stream"/> from which any feedback from the server can be read.</param>
698
694
/// <param name="directoryInfo">The directory to upload.</param>
699
- /// <param name="notifyOnEmptyFile">Should the <see cref="Uploading"/> event be raised when the file is empty?</param>
700
- private void UploadDirectoryContent ( IChannelSession channel , Stream input , DirectoryInfo directoryInfo , bool notifyOnEmptyFile = false )
695
+ private void UploadDirectoryContent ( IChannelSession channel , Stream input , DirectoryInfo directoryInfo )
701
696
{
702
697
// Upload files
703
698
var files = directoryInfo . GetFiles ( ) ;
@@ -707,7 +702,7 @@ private void UploadDirectoryContent(IChannelSession channel, Stream input, Direc
707
702
{
708
703
UploadTimes ( channel , input , file ) ;
709
704
UploadFileModeAndName ( channel , input , source . Length , file . Name ) ;
710
- UploadFileContent ( channel , input , source , file . Name , notifyOnEmptyFile ) ;
705
+ UploadFileContent ( channel , input , source , file . Name ) ;
711
706
}
712
707
}
713
708
@@ -717,7 +712,7 @@ private void UploadDirectoryContent(IChannelSession channel, Stream input, Direc
717
712
{
718
713
UploadTimes ( channel , input , directory ) ;
719
714
UploadDirectoryModeAndName ( channel , input , directory . Name ) ;
720
- UploadDirectoryContent ( channel , input , directory , notifyOnEmptyFile ) ;
715
+ UploadDirectoryContent ( channel , input , directory ) ;
721
716
}
722
717
723
718
// Mark upload of current directory complete
0 commit comments