@@ -209,7 +209,8 @@ private static List<KeyValuePair<HostEntry, List<string>>> Initialize(string com
209
209
password += key . KeyChar ;
210
210
}
211
211
}
212
- byte [ ] bytes = ProtectedData . Protect ( Encoding . UTF8 . GetBytes ( userName + "|" + password ) , null , DataProtectionScope . CurrentUser ) ;
212
+ byte [ ] bytes = ProtectedData . Protect ( Encoding . UTF8 . GetBytes ( userName + "|" + password ) , null ,
213
+ DataProtectionScope . CurrentUser ) ;
213
214
File . WriteAllBytes ( loginPath , bytes ) ;
214
215
}
215
216
if ( ! File . Exists ( loginPath ) )
@@ -218,7 +219,8 @@ private static List<KeyValuePair<HostEntry, List<string>>> Initialize(string com
218
219
}
219
220
{
220
221
byte [ ] protectedBytes = File . ReadAllBytes ( loginPath ) ;
221
- string unprotectedBytes = Encoding . UTF8 . GetString ( ProtectedData . Unprotect ( protectedBytes , null , DataProtectionScope . CurrentUser ) ) ;
222
+ string unprotectedBytes = Encoding . UTF8 . GetString ( ProtectedData . Unprotect ( protectedBytes , null ,
223
+ DataProtectionScope . CurrentUser ) ) ;
222
224
int pos = unprotectedBytes . IndexOf ( '|' ) ;
223
225
if ( pos < 0 )
224
226
{
@@ -323,7 +325,7 @@ private static long BackupFile(string root, string remotePath, SftpClient client
323
325
324
326
try
325
327
{
326
- SftpFile file = client . Get ( remotePath ) ;
328
+ var file = client . Get ( remotePath ) ;
327
329
if ( file . IsRegularFile &&
328
330
( ! File . Exists ( fileName ) || file . LastWriteTimeUtc > File . GetLastWriteTimeUtc ( fileName ) ) )
329
331
{
@@ -378,7 +380,7 @@ private static long BackupFolder(HostEntry host, string root, string path, SftpC
378
380
{
379
381
continue ;
380
382
}
381
- SftpFile file ;
383
+ ISftpFile file ;
382
384
try
383
385
{
384
386
file = client . Get ( fileOrFolder ) ;
@@ -400,7 +402,7 @@ private static long BackupFolder(HostEntry host, string root, string path, SftpC
400
402
{
401
403
try
402
404
{
403
- SftpFile [ ] files = client . ListDirectory ( fileOrFolder ) . Where ( f => f . IsRegularFile || ( f . IsDirectory && ! f . Name . StartsWith ( "." ) ) ) . ToArray ( ) ;
405
+ var files = client . ListDirectory ( fileOrFolder ) . Where ( f => f . IsRegularFile || ( f . IsDirectory && ! f . Name . StartsWith ( "." ) ) ) . ToArray ( ) ;
404
406
Parallel . ForEach ( files . Where ( f => f . IsRegularFile && ( host . IgnoreRegex == null || ! host . IgnoreRegex . IsMatch ( f . FullName ) ) ) , parallelOptions , ( _file ) =>
405
407
{
406
408
Interlocked . Add ( ref size , BackupFile ( root , _file . FullName , client ) ) ;
0 commit comments