File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/main/java/com/browserstack/appautomate Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1212import com .browserstack .automate .model .Build ;
1313import com .browserstack .automate .model .Session ;
1414import com .browserstack .client .BrowserStackClient ;
15+ import com .browserstack .client .BrowserStackRequest ;
1516import com .browserstack .client .exception .BrowserStackException ;
1617import com .browserstack .client .util .Tools ;
1718import com .google .api .client .http .FileContent ;
@@ -75,8 +76,10 @@ public AppUploadResponse uploadApp(String filePath)
7576 String .format ("form-data; name=\" file\" ; filename=\" %s\" " , file .getName ())));
7677 content .addPart (part );
7778
78- AppUploadResponse appUploadResponse =
79- newRequest (Method .POST , "/upload" ).body (content ).asObject (AppUploadResponse .class );
79+ BrowserStackRequest request = newRequest (Method .POST , "/upload" );
80+ // Setting read timeout to 0(infinity), as for large files it takes a lot of time.
81+ request .getHttpRequest ().setReadTimeout (0 );
82+ AppUploadResponse appUploadResponse = request .body (content ).asObject (AppUploadResponse .class );
8083
8184 if (appUploadResponse == null || Tools .isStringEmpty (appUploadResponse .getAppUrl ())) {
8285 throw new AppAutomateException ("App upload failed!" , 0 );
You can’t perform that action at this time.
0 commit comments