JDK9 compatibility: replace DatatypeConverter with Base64 by valfirst · Pull Request #999 · appium/java-client

Expand Up @@ -23,7 +23,8 @@
import org.openqa.selenium.remote.Response;
import javax.xml.bind.DatatypeConverter; import java.nio.charset.StandardCharsets; import java.util.Base64;
public interface InteractsWithFiles extends ExecutesMethod {
Expand All @@ -50,7 +51,7 @@ default byte[] pullFile(String remotePath) { Response response = execute(PULL_FILE, ImmutableMap.of("path", remotePath)); String base64String = response.getValue().toString();
return DatatypeConverter.parseBase64Binary(base64String); return Base64.getDecoder().decode(base64String.getBytes(StandardCharsets.UTF_8)); }
/** Expand All @@ -76,7 +77,7 @@ default byte[] pullFolder(String remotePath) { Response response = execute(PULL_FOLDER, ImmutableMap.of("path", remotePath)); String base64String = response.getValue().toString();
return DatatypeConverter.parseBase64Binary(base64String); return Base64.getDecoder().decode(base64String.getBytes(StandardCharsets.UTF_8)); }
}