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); } };
for (int i = 0; i < deviceModel.size(); i++) { DeviceEntry test = (DeviceEntry) deviceModel.elementAt(i); if (test != entry && test.getFileName() != null && test.getFileName().equals(entry.getFileName())) { canDeleteFile = false; break; File deviceFile = new File(Config.getConfigPath(), entry.getFileName()); deviceFile.delete();
if (entry.getFileName() != null) { URL[] urls = new URL[1]; urls[0] = new File(Config.getConfigPath(), entry.getFileName()).toURI().toURL(); classLoader = Common.createExtensionsClassLoader(urls);
if (deviceInput != null && deviceInput.getFileName() != null) { deviceOutputFile = new File(pathFile, deviceInput.getFileName()); if (!allowOverride(deviceOutputFile)) { return; AppletProducer.createMidlet(new URL(midletInput), midletOutputFile); IOUtils.copyFile(appletJarFile, appletPackageOutputFile); if (deviceInput != null && deviceInput.getFileName() != null) { IOUtils.copyFile(new File(Config.getConfigPath(), deviceInput.getFileName()), deviceOutputFile);
public static void addDeviceEntry(DeviceEntry entry) { for (Enumeration en = getDeviceEntries().elements(); en.hasMoreElements();) { DeviceEntry test = (DeviceEntry) en.nextElement(); if (test.getDescriptorLocation().equals(entry.getDescriptorLocation())) { return; } } XMLElement devicesXml = configXml.getChildOrNew("devices"); XMLElement deviceXml = devicesXml.addChild("device"); if (entry.isDefaultDevice()) { deviceXml.setAttribute("default", "true"); } deviceXml.addChild("name", entry.getName()); deviceXml.addChild("filename", entry.getFileName()); deviceXml.addChild("descriptor", entry.getDescriptorLocation()); saveConfig(); }
try { if (deviceClass == null) { if (defaultDevice.getFileName() != null) { URL[] urls = new URL[1]; urls[0] = new File(Config.getConfigPath(), defaultDevice.getFileName()).toURI().toURL(); classLoader = createExtensionsClassLoader(urls);
File src = new File(getConfigPath(), entry.getFileName()); File dst = File.createTempFile("dev", ".jar", getConfigPath()); IOUtils.copyFile(src, dst);
try { ClassLoader classLoader = getClass().getClassLoader(); if (entry.getFileName() != null) { URL[] urls = new URL[1]; urls[0] = new File(Config.getConfigPath(), entry.getFileName()).toURI().toURL(); classLoader = Common.createExtensionsClassLoader(urls);