protected File getSuiteFolder() { return new File(Config.getConfigPath(), "suite-" + emulator.getLauncher().getSuiteName()); }
public static void saveConfig() { urlsMRU.save(configXml.getChildOrNew("files").getChildOrNew("recent")); File configFile = new File(getConfigPath(), "config2.xml"); getConfigPath().mkdirs(); FileWriter fw = null; try { fw = new FileWriter(configFile); configXml.write(fw); fw.close(); } catch (IOException ex) { Logger.error(ex); } finally { IOUtils.closeQuietly(fw); } }
private static void loadConfigFile(String configFileName) throws IOException { File configFile = new File(getConfigPath(), configFileName); InputStream is = null; String xml = ""; try { InputStream dis = new BufferedInputStream(is = new FileInputStream(configFile)); while (dis.available() > 0) { byte[] b = new byte[dis.available()]; dis.read(b); xml += new String(b); } configXml = new XMLElement(); configXml.parseString(xml); } catch (XMLParseException e) { Logger.error(e); createDefaultConfigXml(); } finally { IOUtils.closeQuietly(is); } }
public String getDescriptorLocation() { if (descriptorLocation == null) { URL[] urls = new URL[1]; try { urls[0] = new File(Config.getConfigPath(), fileName).toURI().toURL(); ClassLoader classLoader = Common.createExtensionsClassLoader(urls); Class deviceClass = Class.forName(className, true, classLoader); Device device = (Device) deviceClass.newInstance(); com.barteo.emulator.EmulatorContext oldContext = new com.barteo.emulator.EmulatorContext(emulatorContext); device.init(oldContext); descriptorLocation = device.getDescriptorLocation(); } catch (MalformedURLException ex) { Logger.error(ex); } catch (ClassNotFoundException ex) { Logger.error(ex); } catch (InstantiationException ex) { Logger.error(ex); } catch (IllegalAccessException ex) { Logger.error(ex); } } return descriptorLocation; }
File deviceFile = new File(Config.getConfigPath(), fileChooser.getSelectedFile().getName()); if (deviceFile.exists()) { deviceFile = File.createTempFile("device", ".jar", Config.getConfigPath());
Config.emulatorContext = emulatorContext; File configFile = new File(getConfigPath(), "config2.xml"); try { if (configFile.exists()) { loadConfigFile("config2.xml"); } else { configFile = new File(getConfigPath(), "config.xml"); if (configFile.exists()) { File src = new File(getConfigPath(), entry.getFileName()); File dst = File.createTempFile("dev", ".jar", getConfigPath()); IOUtils.copyFile(src, dst); entry.setFileName(dst.getName());
if (entry.getFileName() != null) { URL[] urls = new URL[1]; urls[0] = new File(Config.getConfigPath(), entry.getFileName()).toURI().toURL(); classLoader = Common.createExtensionsClassLoader(urls);
public void actionPerformed(ActionEvent ev) { DeviceEntry entry = (DeviceEntry) lsDevices.getSelectedValue(); boolean canDeleteFile = true; for (Enumeration en = lsDevicesModel.elements(); en.hasMoreElements();) { DeviceEntry test = (DeviceEntry) en.nextElement(); if (test != entry && test.getFileName() != null && test.getFileName().equals(entry.getFileName())) { canDeleteFile = false; break; } } if (canDeleteFile) { File deviceFile = new File(Config.getConfigPath(), entry.getFileName()); deviceFile.delete(); } if (entry.isDefaultDevice()) { for (Enumeration en = lsDevicesModel.elements(); en.hasMoreElements();) { DeviceEntry tmp = (DeviceEntry) en.nextElement(); if (!tmp.canRemove()) { tmp.setDefaultDevice(true); break; } } } lsDevicesModel.removeElement(entry); Config.removeDeviceEntry(entry); } };
File deviceFile = new File(Config.getConfigPath(), entry.getFileName()); deviceFile.delete();
File deviceFile = new File(Config.getConfigPath(), file.getName()); if (deviceFile.exists()) { deviceFile = File.createTempFile("device", ".jar", Config.getConfigPath());
IOUtils.copyFile(appletJarFile, appletPackageOutputFile); if (deviceInput != null && deviceInput.getFileName() != null) { IOUtils.copyFile(new File(Config.getConfigPath(), deviceInput.getFileName()), deviceOutputFile);
if (defaultDevice.getFileName() != null) { URL[] urls = new URL[1]; urls[0] = new File(Config.getConfigPath(), defaultDevice.getFileName()).toURI().toURL(); classLoader = createExtensionsClassLoader(urls);
if (entry.getFileName() != null) { URL[] urls = new URL[1]; urls[0] = new File(Config.getConfigPath(), entry.getFileName()).toURI().toURL(); classLoader = Common.createExtensionsClassLoader(urls);