Skip to content

Commit 296d9e3

Browse files
committed
added PullFolder
1 parent ce6eed7 commit 296d9e3

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/main/java/io/appium/java_client/AppiumDriver.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,20 @@ public void pushFile(String remotePath, byte[] base64Data) {
176176
execute(PUSH_FILE, builder.build());
177177
}
178178

179+
/**
180+
* Pull a folder from the simulator/device. Does not work on iOS Real Devices, but works on simulators
181+
*
182+
* @param remotePath On Android and iOS, this is either the path to the file (relative to the root of the app's file system).
183+
* On iOS only, if path starts with /AppName.app, which will be replaced with the application's .app directory
184+
* @return A byte array of Base64 encoded data, representing a ZIP ARCHIVE of the contents of the requested folder.
185+
*/
186+
public byte[] pullFolder(String remotePath) {
187+
Response response = execute(PULL_FILE, ImmutableMap.of("path", remotePath));
188+
String base64String = response.getValue().toString();
189+
190+
return DatatypeConverter.parseBase64Binary(base64String);
191+
}
192+
179193
/**
180194
* Hides the keyboard if it is showing.
181195
* This is an iOS only command.

src/main/java/io/appium/java_client/MobileCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public interface MobileCommand {
3131
String SET_VALUE = "setValue";
3232
String PULL_FILE = "pullFile";
3333
String PUSH_FILE = "pushFile";
34+
String PULL_FOLDER = "pullFolder";
3435
String HIDE_KEYBOARD = "hideKeyboard";
3536
String RUN_APP_IN_BACKGROUND = "runAppInBackground";
3637
String PERFORM_TOUCH_ACTION = "performTouchAction";

0 commit comments

Comments
 (0)