Tabnine Logo
CompositeMetadataRepository
Code IndexAdd Tabnine to your IDE (free)

How to use
CompositeMetadataRepository
in
org.eclipse.equinox.internal.p2.metadata.repository

Best Java code snippets using org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository (Showing top 20 results out of 315)

origin: org.eclipse.equinox.p2.metadata/repository

public void addChild(URI childURI) {
  try {
    addChild(childURI, true, null, false, null);
  } catch (ProvisionException e) {
    //already logged
  }
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.p2.metadata.repository

@Override
public String toString() {
  return getChildren().toString();
}
origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.p2.metadata.repository

public IMetadataRepository create(URI location, String name, String type, Map<String, String> properties) {
  return new CompositeMetadataRepository(getManager(), location, name, properties);
}
origin: org.eclipse.equinox.p2.metadata/repository

public CompositeRepositoryState toState() {
  CompositeRepositoryState result = new CompositeRepositoryState();
  result.setName(getName());
  result.setType(getType());
  result.setVersion(getVersion());
  result.setLocation(getLocation());
  result.setDescription(getDescription());
  result.setProvider(getProvider());
  result.setProperties(getProperties());
  // it is important to directly access the field so we have the relative URIs
  result.setChildren(childrenURIs.toArray(new URI[childrenURIs.size()]));
  return result;
}
origin: org.eclipse.platform/org.eclipse.equinox.p2.publisher

CompositeMetadataRepository contextMetadata = CompositeMetadataRepository.createMemoryComposite(agent);
if (contextMetadata != null) {
  for (int i = 0; i < contextMetadataRepositories.length; i++)
    contextMetadata.addChild(contextMetadataRepositories[i]);
  if (contextMetadata.getChildren().size() > 0)
    publisherInfo.setContextMetadataRepository(contextMetadata);
origin: org.eclipse.equinox.p2.metadata/repository

private void save() {
  if (!isModifiable())
    return;
  File file = getActualLocation(getLocation());
  File jarFile = getActualLocation(getLocation(), JAR_EXTENSION);
  boolean compress = "true".equalsIgnoreCase(getProperty(PROP_COMPRESSED)); //$NON-NLS-1$
  try {
    OutputStream output = null;
    new CompositeRepositoryIO().write(toState(), output, PI_REPOSITORY_TYPE);
  } catch (IOException e) {
    LogHelper.log(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_WRITE, NLS.bind(Messages.io_failedWrite, getLocation()), e));
origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.p2.metadata.repository

private void addChild(URI childURI, boolean save, IProgressMonitor monitor, boolean propagateException, List<URI> repositoriesToBeRemovedOnFailure) throws ProvisionException {
  SubMonitor sub = SubMonitor.convert(monitor);
  URI absolute = URIUtil.makeAbsolute(childURI, getLocation());
  if (childrenURIs.contains(childURI) || childrenURIs.contains(absolute)) {
    sub.done();
    save();
  try {
    boolean currentLoaded = getManager().contains(absolute);
    IMetadataRepository currentRepo = getManager().loadRepository(absolute, sub);
    if (!currentLoaded) {
      getManager().setEnabled(absolute, false);
      getManager().setRepositoryProperty(absolute, IRepository.PROP_SYSTEM, String.valueOf(true));
      if (propagateException)
        repositoriesToBeRemovedOnFailure.add(absolute);
      removeFromRepoManager(repositoriesToBeRemovedOnFailure);
      String msg = NLS.bind(Messages.io_failedRead, getLocation());
      throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_READ, msg, e));
origin: com.github.pms1.tppt/tppt-mirror-application

    .createMemoryComposite(ourAgent);
for (URI sr : ms.sourceRepositories)
  sourceMetadataRepo.addChild(sr);
  Set<IInstallableUnit> queryResult = sourceMetadataRepo.query(q, monitor).toUnmodifiableSet();
  if (queryResult.isEmpty())
    throw new RuntimeException("IU not found: " + iu);
        for (IInstallableUnit iu1 : sourceMetadataRepo.query(
            QueryUtil.createIUQuery(iu.getId() + ".source", iu.getVersion()), monitor))
          if (getType(iu1) == Type.source_bundle) {
              .query(QueryUtil.createIUQuery(c, iu.getVersion()), monitor))
            if (root1.add(iu1))
              System.out.println("Adding " + iu1 + " as source of " + iu);
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.p2.metadata.repository

CompositeMetadataRepository(IMetadataRepositoryManager manager, CompositeRepositoryState state, IProgressMonitor monitor) throws ProvisionException {
  super(manager.getAgent(), state.getName(), state.getType(), state.getVersion(), state.getLocation(), state.getDescription(), state.getProvider(), state.getProperties());
  this.manager = manager;
  SubMonitor sub = SubMonitor.convert(monitor, 100 * state.getChildren().length);
  List<URI> repositoriesToBeRemovedOnFailure = new ArrayList<URI>();
  boolean failOnChildFailure = shouldFailOnChildFailure(state);
  for (URI child : state.getChildren())
    addChild(child, false, sub.newChild(100), failOnChildFailure, repositoriesToBeRemovedOnFailure);
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.p2.metadata.repository

public void removeChild(URI childURI) {
  boolean removed = childrenURIs.remove(childURI);
  // if the child wasn't there make sure and try the other permutation
  // (absolute/relative) to see if it really is in the list.
  URI other = childURI.isAbsolute() ? URIUtil.makeRelative(childURI, getLocation()) : URIUtil.makeAbsolute(childURI, getLocation());
  if (!removed)
    removed = childrenURIs.remove(other);
  if (removed) {
    // we removed the child from the list so remove the associated repo object as well
    IMetadataRepository found = null;
    for (IMetadataRepository current : loadedRepos) {
      URI repoLocation = current.getLocation();
      if (URIUtil.sameURI(childURI, repoLocation) || URIUtil.sameURI(other, repoLocation)) {
        found = current;
        break;
      }
    }
    if (found != null)
      loadedRepos.remove(found);
    save();
  }
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.p2.metadata.repository

private boolean isLocal() {
  return "file".equalsIgnoreCase(getLocation().getScheme()); //$NON-NLS-1$
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.p2.metadata.repository

public static File getActualLocation(URI location) {
  return getActualLocation(location, XML_EXTENSION);
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.p2.metadata.repository

URI jarLocation = CompositeMetadataRepository.getActualLocationURI(location, JAR_EXTENSION);
URI xmlLocation = CompositeMetadataRepository.getActualLocationURI(location, XML_EXTENSION);
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.p2.publisher

CompositeMetadataRepository contextMetadata = CompositeMetadataRepository.createMemoryComposite(agent);
if (contextMetadata != null) {
  for (int i = 0; i < contextMetadataRepositories.length; i++)
    contextMetadata.addChild(contextMetadataRepositories[i]);
  if (contextMetadata.getChildren().size() > 0)
    publisherInfo.setContextMetadataRepository(contextMetadata);
origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.p2.metadata.repository

public CompositeRepositoryState toState() {
  CompositeRepositoryState result = new CompositeRepositoryState();
  result.setName(getName());
  result.setType(getType());
  result.setVersion(getVersion());
  result.setLocation(getLocation());
  result.setDescription(getDescription());
  result.setProvider(getProvider());
  result.setProperties(getProperties());
  // it is important to directly access the field so we have the relative URIs
  result.setChildren(childrenURIs.toArray(new URI[childrenURIs.size()]));
  return result;
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.p2.metadata.repository

private void save() {
  if (!isModifiable())
    return;
  File file = getActualLocation(getLocation());
  File jarFile = getActualLocation(getLocation(), JAR_EXTENSION);
  boolean compress = "true".equalsIgnoreCase(getProperty(PROP_COMPRESSED)); //$NON-NLS-1$
  try {
    OutputStream output = null;
    new CompositeRepositoryIO().write(toState(), output, PI_REPOSITORY_TYPE);
  } catch (IOException e) {
    LogHelper.log(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_WRITE, NLS.bind(Messages.io_failedWrite, getLocation()), e));
origin: org.eclipse.equinox.p2.metadata/repository

private void addChild(URI childURI, boolean save, IProgressMonitor monitor, boolean propagateException, List<URI> repositoriesToBeRemovedOnFailure) throws ProvisionException {
  SubMonitor sub = SubMonitor.convert(monitor);
  URI absolute = URIUtil.makeAbsolute(childURI, getLocation());
  if (childrenURIs.contains(childURI) || childrenURIs.contains(absolute)) {
    sub.done();
    save();
  try {
    boolean currentLoaded = getManager().contains(absolute);
    IMetadataRepository currentRepo = getManager().loadRepository(absolute, sub);
    if (!currentLoaded) {
      getManager().setEnabled(absolute, false);
      getManager().setRepositoryProperty(absolute, IRepository.PROP_SYSTEM, String.valueOf(true));
      if (propagateException)
        repositoriesToBeRemovedOnFailure.add(absolute);
      removeFromRepoManager(repositoriesToBeRemovedOnFailure);
      String msg = NLS.bind(Messages.io_failedRead, getLocation());
      throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_READ, msg, e));
origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.p2.metadata.repository

CompositeMetadataRepository(IMetadataRepositoryManager manager, CompositeRepositoryState state, IProgressMonitor monitor) throws ProvisionException {
  super(manager.getAgent(), state.getName(), state.getType(), state.getVersion(), state.getLocation(), state.getDescription(), state.getProvider(), state.getProperties());
  this.manager = manager;
  SubMonitor sub = SubMonitor.convert(monitor, 100 * state.getChildren().length);
  List<URI> repositoriesToBeRemovedOnFailure = new ArrayList<URI>();
  boolean failOnChildFailure = shouldFailOnChildFailure(state);
  for (URI child : state.getChildren())
    addChild(child, false, sub.newChild(100), failOnChildFailure, repositoriesToBeRemovedOnFailure);
}
origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.p2.metadata.repository

public void removeChild(URI childURI) {
  boolean removed = childrenURIs.remove(childURI);
  // if the child wasn't there make sure and try the other permutation
  // (absolute/relative) to see if it really is in the list.
  URI other = childURI.isAbsolute() ? URIUtil.makeRelative(childURI, getLocation()) : URIUtil.makeAbsolute(childURI, getLocation());
  if (!removed)
    removed = childrenURIs.remove(other);
  if (removed) {
    // we removed the child from the list so remove the associated repo object as well
    IMetadataRepository found = null;
    for (IMetadataRepository current : loadedRepos) {
      URI repoLocation = current.getLocation();
      if (URIUtil.sameURI(childURI, repoLocation) || URIUtil.sameURI(other, repoLocation)) {
        found = current;
        break;
      }
    }
    if (found != null)
      loadedRepos.remove(found);
    save();
  }
}
origin: org.eclipse.equinox.p2.metadata/repository

private boolean isLocal() {
  return "file".equalsIgnoreCase(getLocation().getScheme()); //$NON-NLS-1$
}
org.eclipse.equinox.internal.p2.metadata.repositoryCompositeMetadataRepository

Most used methods

  • addChild
  • getChildren
  • createMemoryComposite
    Create a Composite repository in memory.
  • <init>
  • getActualLocation
  • getActualLocationURI
  • getDescription
  • getLocation
  • getManager
  • getName
  • getProperties
  • getProperty
  • getProperties,
  • getProperty,
  • getProvider,
  • getType,
  • getVersion,
  • isLocal,
  • isModifiable,
  • removeFromRepoManager,
  • save,
  • setDescription

Popular in Java

  • Start an intent from android
  • findViewById (Activity)
  • getContentResolver (Context)
  • putExtra (Intent)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • JFileChooser (javax.swing)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now