1- using System ;
1+ using ShareFile . Api . Client ;
2+ using ShareFile . Api . Client . Models ;
3+ using ShareFile . Api . Powershell . Log ;
4+ using ShareFile . Api . Powershell . Parallel ;
5+ using System ;
26using System . Collections . Generic ;
7+ using System . Collections . ObjectModel ;
8+ using System . IO ;
39using System . Linq ;
4- using System . Text ;
5- using System . Threading . Tasks ;
610using System . Management . Automation ;
7- using ShareFile . Api ;
8- using ShareFile . Api . Models ;
9- using System . IO ;
10- using ShareFile . Api . Client ;
11- using ShareFile . Api . Client . Transfers ;
12- using ShareFile . Api . Client . FileSystem ;
13- using ShareFile . Api . Client . Transfers . Uploaders ;
1411using System . Threading ;
15- using ShareFile . Api . Powershell . Parallel ;
16- using ShareFile . Api . Powershell . Log ;
17- using System . Collections . ObjectModel ;
12+ using System . Threading . Tasks ;
1813
1914namespace ShareFile . Api . Powershell
2015{
@@ -163,7 +158,7 @@ private void StartCopying(String[] paramPath, String paramDestination, bool para
163158 var targetProviderPath = this . SessionState . Path . GetUnresolvedProviderPathFromPSPath ( paramDestination , out targetProvider , out targetDrive ) ;
164159 bool isTargetLocal = targetProvider . ImplementingType == typeof ( Microsoft . PowerShell . Commands . FileSystemProvider ) ;
165160 bool isTargetSF = targetProvider . ImplementingType == typeof ( ShareFileProvider ) ;
166- Models . Item targetItem = null ;
161+ Item targetItem = null ;
167162 if ( isTargetSF )
168163 {
169164 targetItem = ShareFileProvider . GetShareFileItem ( ( ShareFileDriveInfo ) targetDrive , targetProviderPath ) ;
@@ -273,11 +268,11 @@ private void StartCopying(String[] paramPath, String paramDestination, bool para
273268 }
274269 }
275270
276- private void RecursiveUpload ( ShareFileClient client , int uploadId , FileSystemInfo source , Models . Item target )
271+ private void RecursiveUpload ( ShareFileClient client , int uploadId , FileSystemInfo source , Item target )
277272 {
278273 if ( source is DirectoryInfo )
279274 {
280- var newFolder = new Models . Folder ( ) { Name = source . Name } ;
275+ var newFolder = new Folder ( ) { Name = source . Name } ;
281276 newFolder = client . Items . CreateFolder ( target . url , newFolder , Force || ResumeSupport . IsPending , false ) . Execute ( ) ;
282277
283278 ActionManager actionManager = new ActionManager ( this , source . Name ) ;
@@ -314,9 +309,9 @@ private void RecursiveUpload(ShareFileClient client, int uploadId, FileSystemInf
314309 }
315310 }
316311
317- private void RecursiveDownload ( ShareFileClient client , int downloadId , Models . Item source , DirectoryInfo target )
312+ private void RecursiveDownload ( ShareFileClient client , int downloadId , Item source , DirectoryInfo target )
318313 {
319- if ( source is Models . Folder )
314+ if ( source is Folder )
320315 {
321316 var children = client . Items . GetChildren ( source . url ) . Execute ( ) ;
322317 var subdirCheck = new DirectoryInfo ( System . IO . Path . Combine ( target . FullName , source . FileName ) ) ;
@@ -329,16 +324,16 @@ private void RecursiveDownload(ShareFileClient client, int downloadId, Models.It
329324 foreach ( var child in children . Feed )
330325 {
331326
332- if ( child is Models . Folder )
327+ if ( child is Folder )
333328 {
334329 RecursiveDownload ( client , downloadId , child , subdir ) ;
335330 }
336- else if ( child is Models . File )
331+ else if ( child is Client . Models . File )
337332 {
338333 if ( ! ResumeSupport . IsPending || ! ResumeSupport . CheckFileStatus ( child . FileName ) )
339334 {
340335 ActionType actionType = Force || ResumeSupport . IsPending ? ActionType . Force : ActionType . None ;
341- DownloadAction downloadAction = new DownloadAction ( FileSupport , client , downloadId , ( Models . File ) child , subdir , actionType ) ;
336+ DownloadAction downloadAction = new DownloadAction ( FileSupport , client , downloadId , ( Client . Models . File ) child , subdir , actionType ) ;
342337 actionManager . AddAction ( downloadAction ) ;
343338 }
344339 }
@@ -347,13 +342,13 @@ private void RecursiveDownload(ShareFileClient client, int downloadId, Models.It
347342 actionManager . Execute ( ) ;
348343 }
349344 }
350- else if ( source is Models . File )
345+ else if ( source is Client . Models . File )
351346 {
352347 ActionManager actionManager = new ActionManager ( this , source . FileName ) ;
353348 if ( ! ResumeSupport . IsPending || ! ResumeSupport . CheckFileStatus ( source . FileName ) )
354349 {
355350 ActionType actionType = Force || ResumeSupport . IsPending ? ActionType . Force : ActionType . None ;
356- DownloadAction downloadAction = new DownloadAction ( FileSupport , client , downloadId , ( Models . File ) source , target , actionType ) ;
351+ DownloadAction downloadAction = new DownloadAction ( FileSupport , client , downloadId , ( Client . Models . File ) source , target , actionType ) ;
357352 actionManager . AddAction ( downloadAction ) ;
358353 }
359354 actionManager . Execute ( ) ;
0 commit comments