Author: yradtsevich
Date: 2011-11-15 07:22:32 -0500 (Tue, 15 Nov 2011)
New Revision: 36344
Modified:
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/BrowserSim.java
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/DevicesManager.java
Log:
https://issues.jboss.org/browse/JBIDE-9539 : Browsersim app for testing mobile/desktop web
apps
- now configuration file is loaded as stream, not as file
Modified:
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/BrowserSim.java
===================================================================
---
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/BrowserSim.java 2011-11-15
02:55:00 UTC (rev 36343)
+++
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/BrowserSim.java 2011-11-15
12:22:32 UTC (rev 36344)
@@ -292,7 +292,7 @@
DevicesList devicesList;
try {
- devicesList = DevicesManager.loadDevicesList(getResourceAsFile(
+ devicesList = DevicesManager.loadDevicesList(getResourceAsStream(
"/org/jboss/tools/browsersim/resources/config/devices.cfg"));
} catch (IOException e) {
devicesList = new DevicesList(new ArrayList<Device>(), 0);
Modified:
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/DevicesManager.java
===================================================================
---
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/DevicesManager.java 2011-11-15
02:55:00 UTC (rev 36343)
+++
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/DevicesManager.java 2011-11-15
12:22:32 UTC (rev 36344)
@@ -13,9 +13,10 @@
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
-import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Observable;
@@ -121,8 +122,8 @@
writer.close();
}
- public static DevicesList loadDevicesList(File file) throws IOException {
- BufferedReader reader = new BufferedReader(new FileReader(file));
+ public static DevicesList loadDevicesList(InputStream inputStream) throws IOException {
+ BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
String nextLine = reader.readLine();
int selectedDeviceIndex = 0;