-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nick Abalov
authored and
Nick Abalov
committed
Mar 4, 2016
1 parent
efb0b81
commit 5df6a7b
Showing
10 changed files
with
118 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
Winium/Winium.StoreApps.Driver/CommandExecutors/PullFileExecutor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
namespace Winium.StoreApps.Driver.CommandExecutors | ||
{ | ||
using System; | ||
using System.IO; | ||
|
||
using Winium.StoreApps.Common; | ||
using Winium.StoreApps.Driver.Automator; | ||
|
||
internal class PullFileExecutor : CommandExecutorBase | ||
{ | ||
#region Methods | ||
|
||
protected override string DoImpl() | ||
{ | ||
var path = Automator.GetValue<string>(this.ExecutedCommand.Parameters, "path"); | ||
|
||
var localPath = Path.GetTempFileName(); | ||
|
||
try | ||
{ | ||
this.Automator.Deployer.ReceiveFile("Local", path, localPath); | ||
|
||
var bytes = File.ReadAllBytes(localPath); | ||
var data = Convert.ToBase64String(bytes); | ||
return this.JsonResponse(ResponseStatus.Success, data); | ||
} | ||
finally | ||
{ | ||
File.Delete(localPath); | ||
} | ||
} | ||
|
||
#endregion | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
Winium/Winium.StoreApps.Driver/CommandExecutors/PushFileExecutor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
namespace Winium.StoreApps.Driver.CommandExecutors | ||
{ | ||
using System; | ||
using System.IO; | ||
|
||
using Winium.StoreApps.Driver.Automator; | ||
|
||
internal class PushFileExecutor : CommandExecutorBase | ||
{ | ||
#region Methods | ||
|
||
protected override string DoImpl() | ||
{ | ||
var path = Automator.GetValue<string>(this.ExecutedCommand.Parameters, "path"); | ||
var data = Automator.GetValue<string>(this.ExecutedCommand.Parameters, "data"); | ||
|
||
var localPath = Path.GetTempFileName(); | ||
|
||
try | ||
{ | ||
File.WriteAllBytes(localPath, Convert.FromBase64String(data)); | ||
this.Automator.Deployer.SendFile("Local", localPath, path); | ||
} | ||
finally | ||
{ | ||
File.Delete(localPath); | ||
} | ||
|
||
return this.JsonResponse(); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.