/** * Activate the given update site. * * @param updateSite the update site to activate * @param progress the object to display the progress * @throws ParserConfigurationException * @throws IOException * @throws SAXException */ public void activateUpdateSite(final UpdateSite updateSite, final Progress progress) throws ParserConfigurationException, IOException, SAXException { if (updateSite.isActive()) return; updateSite.setActive(true); reReadUpdateSite(updateSite.getName(), progress); markForUpdate(updateSite.getName(), false); }
/** Gets the list of known update sites. */ public Collection<UpdateSite> getUpdateSites(final boolean evenDisabled) { if (evenDisabled) return updateSites.values(); final List<UpdateSite> result = new ArrayList<UpdateSite>(); for (final UpdateSite site : updateSites.values()) { if (site.isActive()) result.add(site); } return result; }
/** * Deactivates the given update site. * * @param site the site to deactivate * @return the number of files marked for update/install/uninstall */ public int deactivateUpdateSite(final UpdateSite site) { if (!site.isActive()) return 0; final List<FileObject> list = new ArrayList<FileObject>(); final String updateSite = site.getName(); for (final FileObject file : forUpdateSite(updateSite)) { list.add(file); } for (final FileObject file : list) { file.removeFromUpdateSite(updateSite, this); } site.setActive(false); return list.size(); }
public boolean hasUploadableSites() { for (final UpdateSite site : updateSites.values()) if (site.isActive() && site.isUploadable()) return true; return false; }
public UpdateSite getUpdateSite(final String name, final boolean evenDisabled) { if (name == null) return null; final UpdateSite site = updateSites.get(name); return evenDisabled || site == null || site.isActive() ? site : null; }