Skip to content

Commit 39dd35c

Browse files
committed
update: revert version 1.1.5
1 parent eccfe28 commit 39dd35c

File tree

4 files changed

+5
-41
lines changed

4 files changed

+5
-41
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Add this dependency to your project's POM:
1111
<dependency>
1212
<groupId>com.browserstack</groupId>
1313
<artifactId>browserstack-local-java</artifactId>
14-
<version>1.1.5</version>
14+
<version>1.1.4</version>
1515
</dependency>
1616
```
1717

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<groupId>com.browserstack</groupId>
44
<artifactId>browserstack-local-java</artifactId>
55
<packaging>jar</packaging>
6-
<version>1.1.5</version>
6+
<version>1.1.4-SNAPSHOT</version>
77

88
<name>browserstack-local-java</name>
99
<description>Java bindings for BrowserStack Local</description>

src/main/java/com/browserstack/local/Local.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class Local {
2323
private LocalProcess proc = null;
2424

2525
// Current version of binding package, used for --source option of binary
26-
private static final String packageVersion = "1.1.5";
26+
private final String packageVersion = "1.1.4";
2727
private final Map<String, String> parameters;
2828
private final Map<String, String> avoidValueParameters;
2929

@@ -130,15 +130,6 @@ public boolean isRunning() throws Exception {
130130
return isProcessRunning(pid);
131131
}
132132

133-
/**
134-
* Returns the package version
135-
*
136-
* @return {String} package version
137-
*/
138-
public static String getPackageVersion() {
139-
return packageVersion;
140-
}
141-
142133
/**
143134
* Creates a list of command-line arguments for the Local instance
144135
*

src/main/java/com/browserstack/local/LocalBinary.java

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@
22

33
import org.apache.commons.io.FileUtils;
44
import java.io.IOException;
5-
import java.io.InputStream;
65
import java.io.BufferedReader;
76
import java.io.InputStreamReader;
87
import java.io.File;
98
import java.net.URL;
10-
import java.net.URLConnection;
119
import java.util.regex.Pattern;
12-
import java.util.zip.GZIPInputStream;
13-
import java.util.zip.ZipException;
1410

1511
class LocalBinary {
1612

@@ -62,8 +58,7 @@ private void initialize() throws LocalException {
6258
throw new LocalException("Failed to detect OS type");
6359
}
6460

65-
String sourceURL = BIN_URL;
66-
httpPath = sourceURL + binFileName;
61+
httpPath = BIN_URL + binFileName;
6762
}
6863

6964
private boolean isAlpine() {
@@ -179,7 +174,7 @@ private void downloadBinary(String destParentDir, Boolean custom) throws LocalEx
179174
URL url = new URL(httpPath);
180175

181176
File f = new File(source);
182-
newCopyToFile(url, f);
177+
FileUtils.copyURLToFile(url, f);
183178

184179
changePermissions(binaryPath);
185180
} catch (Exception e) {
@@ -197,26 +192,4 @@ private void changePermissions(String path) {
197192
public String getBinaryPath() {
198193
return binaryPath;
199194
}
200-
201-
private static void newCopyToFile(URL url, File f) throws IOException {
202-
URLConnection conn = url.openConnection();
203-
conn.setRequestProperty("User-Agent", "browserstack-local-java/" + Local.getPackageVersion());
204-
conn.setRequestProperty("Accept-Encoding", "gzip, *");
205-
String contentEncoding = conn.getContentEncoding();
206-
207-
if (contentEncoding == null || !contentEncoding.toLowerCase().contains("gzip")) {
208-
FileUtils.copyToFile(conn.getInputStream(), f);
209-
return;
210-
}
211-
212-
try (InputStream stream = new GZIPInputStream(conn.getInputStream())) {
213-
if (System.getenv().containsKey("BROWSERSTACK_LOCAL_DEBUG_GZIP")) {
214-
System.out.println("using gzip in " + conn.getRequestProperty("User-Agent"));
215-
}
216-
217-
FileUtils.copyToFile(stream, f);
218-
} catch (ZipException e) {
219-
FileUtils.copyURLToFile(url, f);
220-
}
221-
}
222195
}

0 commit comments

Comments
 (0)