Package org.eclipse.tycho.model

Examples of org.eclipse.tycho.model.UpdateSite


  }

  private void mirrorUpdateSite(final boolean force)
      throws StorageException, IllegalOperationException, UnsupportedStorageOperationException
  {
    UpdateSite site;
    try {
      final RepositoryItemUid siteUID = createUid(P2Constants.SITE_XML);
      String oldSha1 = null;

      final ResourceStoreRequest request = new ResourceStoreRequest(siteUID.getPath());

      try {
        oldSha1 =
            getLocalStorage().retrieveItem(this, request).getRepositoryItemAttributes().get(
                StorageFileItem.DIGEST_SHA1_KEY);
      }
      catch (final ItemNotFoundException e) {
        // it's okay
      }

      final StorageFileItem siteItem = (StorageFileItem) doRetrieveRemoteItem(request);

      if (!force && oldSha1 != null
          && oldSha1.equals(siteItem.getRepositoryItemAttributes().get(StorageFileItem.DIGEST_SHA1_KEY))) {
        return;
      }
      site = UpdateSite.read(siteItem.getInputStream());
    }
    catch (final Exception e) {
      throw new StorageException("Could not read site.xml", e);
    }

    final List<SiteFeatureRef> features = site.getFeatures();

    log.info("Mirroring " + features.size() + " features from update site " + getName());

    final Set<String> mirrored = new HashSet<String>();
View Full Code Here

TOP

Related Classes of org.eclipse.tycho.model.UpdateSite

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.