private boolean isLocal() { return "file".equalsIgnoreCase(getLocation().getScheme()); //$NON-NLS-1$ }
private boolean isLocal() { return "file".equalsIgnoreCase(getLocation().getScheme()); //$NON-NLS-1$ }
private boolean isLocal() { return "file".equalsIgnoreCase(getLocation().getScheme()); //$NON-NLS-1$ }
public List<URI> getChildren() { List<URI> result = new ArrayList<URI>(); for (URI childURI : childrenURIs) result.add(URIUtil.makeAbsolute(childURI, getLocation())); return result; }
public List<URI> getChildren() { List<URI> result = new ArrayList<URI>(); for (URI childURI : childrenURIs) result.add(URIUtil.makeAbsolute(childURI, getLocation())); return result; }
public List<URI> getChildren() { List<URI> result = new ArrayList<URI>(); for (URI childURI : childrenURIs) result.add(URIUtil.makeAbsolute(childURI, getLocation())); return result; }
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 { 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));
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 { 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));
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 { 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));
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(); } }
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(); } }
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(); } }
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(); if (propagateException) { 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));
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(); if (propagateException) { 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));
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(); if (propagateException) { 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));
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; }
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; }
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; }