Ejemplo n.º 1
0
 /**
  * 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);
 }
Ejemplo n.º 2
0
 /** 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;
 }
Ejemplo n.º 3
0
 /**
  * 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();
 }
Ejemplo n.º 4
0
 public boolean hasUploadableSites() {
   for (final UpdateSite site : updateSites.values())
     if (site.isActive() && site.isUploadable()) return true;
   return false;
 }
Ejemplo n.º 5
0
 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;
 }