public URI getPropertyFileURI() { return CWProject.instance().getWritableURI(LuceneIndexManager.DIR_LUCENE + "/" + getClass().getName(), FileUtil.EXTENSION_PROPERTIES); }
/** * @param newShown * Whether this WebWarning should be shown. */ public void setShown(boolean newShown) { try { shown = newShown; PropertyMap props = new PropertyMap(); props.put(SHOWN_KEY, Boolean.valueOf(shown).toString()); URI outputURI = CWProject.instance().getWritableURI(getClass().getName(), FileUtil.EXTENSION_PROPERTIES); NetUtil.storeProperties(props, outputURI, "JSword WebWarning"); } catch (IOException ex) { log.error("Failed to save JSword WebWarning", ex); } }
/** * Save all properties to the user's local area. Uses the same property name * so as to override it. */ public void save() { PropertyMap props = new PropertyMap(); StringBuilder buf = new StringBuilder(); int i = 1; for (String name : installers.keySet()) { Installer installer = installers.get(name); // Clear the buffer buf.delete(0, buf.length()); buf.append(installer.getType()); buf.append(','); buf.append(name); buf.append(','); buf.append(installer.getInstallerDefinition()); props.put(PREFIX + i++, buf.toString()); } URI outputURI = CWProject.instance().getWritableURI(getClass().getName(), FileUtil.EXTENSION_PLUGIN); try { NetUtil.storeProperties(props, outputURI, "Saved Installer Sites"); } catch (IOException e) { log.error("Failed to save installers", e); } }
/** * Set the current translation, using human readable string. * * @param newTranslation * the translation to use */ public void setCurrent(String newTranslation) { String found = DEFAULT_TRANSLATION; String currentTranslation = ""; for (int i = 0; i < translations.length; i++) { String trans = translations[i]; currentTranslation = toString(translation); if (trans.equals(newTranslation) || currentTranslation.equals(newTranslation)) { found = trans; break; } } try { translation = found; PropertyMap props = new PropertyMap(); if (!DEFAULT_TRANSLATION.equals(translation)) { props.put(TRANSLATION_KEY, translation); } URI outputURI = CWProject.instance().getWritableURI(getClass().getName(), FileUtil.EXTENSION_PROPERTIES); NetUtil.storeProperties(props, outputURI, "BibleDesktop UI Translation"); } catch (IOException ex) { log.error("Failed to save BibleDesktop UI Translation", ex); } }