|
Lines 10-19
Link Here
|
| 10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
| 11 |
package org.eclipse.equinox.p2.internal.repository.tools; |
11 |
package org.eclipse.equinox.p2.internal.repository.tools; |
| 12 |
|
12 |
|
| 13 |
import java.net.URI; |
13 |
import java.net.*; |
| 14 |
import java.net.URISyntaxException; |
|
|
| 15 |
import java.util.*; |
14 |
import java.util.*; |
| 16 |
import org.eclipse.core.runtime.*; |
15 |
import org.eclipse.core.runtime.IProgressMonitor; |
|
|
16 |
import org.eclipse.core.runtime.IStatus; |
| 17 |
import org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository; |
17 |
import org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository; |
| 18 |
import org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository; |
18 |
import org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository; |
| 19 |
import org.eclipse.equinox.internal.p2.repository.helpers.RepositoryHelper; |
19 |
import org.eclipse.equinox.internal.p2.repository.helpers.RepositoryHelper; |
|
Lines 22-34
Link Here
|
| 22 |
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; |
22 |
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; |
| 23 |
import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; |
23 |
import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; |
| 24 |
import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; |
24 |
import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; |
| 25 |
import org.eclipse.equinox.internal.provisional.p2.repository.IRepository; |
25 |
import org.eclipse.equinox.internal.provisional.p2.repository.*; |
| 26 |
import org.eclipse.equinox.internal.provisional.p2.repository.IRepositoryManager; |
26 |
import org.eclipse.osgi.util.NLS; |
| 27 |
|
27 |
|
| 28 |
public abstract class AbstractApplication { |
28 |
public abstract class AbstractApplication { |
|
|
29 |
protected boolean removeAddedRepositories = true; |
| 29 |
|
30 |
|
| 30 |
protected List sourceArtifactRepositories = new ArrayList(); |
31 |
protected List sourceRepositories = new ArrayList(); //List of repository descriptors |
| 31 |
protected List sourceMetadataRepositories = new ArrayList(); |
|
|
| 32 |
protected List artifactReposToRemove = new ArrayList(); |
32 |
protected List artifactReposToRemove = new ArrayList(); |
| 33 |
protected List metadataReposToRemove = new ArrayList(); |
33 |
protected List metadataReposToRemove = new ArrayList(); |
| 34 |
protected List sourceIUs = new ArrayList(); |
34 |
protected List sourceIUs = new ArrayList(); |
|
Lines 40-131
Link Here
|
| 40 |
private CompositeMetadataRepository compositeMetadataRepository = null; |
40 |
private CompositeMetadataRepository compositeMetadataRepository = null; |
| 41 |
private CompositeArtifactRepository compositeArtifactRepository = null; |
41 |
private CompositeArtifactRepository compositeArtifactRepository = null; |
| 42 |
|
42 |
|
| 43 |
public void addSourceMetadataRepository(String location) { |
|
|
| 44 |
URI uri = Activator.getURI(location); |
| 45 |
if (uri != null) |
| 46 |
sourceMetadataRepositories.add(RepositoryHelper.localRepoURIHelper(uri)); |
| 47 |
} |
| 48 |
|
| 49 |
public void addSourceMetadataRepository(URI location) { |
| 50 |
if (location != null) |
| 51 |
sourceMetadataRepositories.add(RepositoryHelper.localRepoURIHelper(location)); |
| 52 |
} |
| 53 |
|
| 54 |
public List getSourceMetadataRepositories() { |
| 55 |
return sourceMetadataRepositories; |
| 56 |
} |
| 57 |
|
| 58 |
public void addSourceArtifactRepository(String location) { |
| 59 |
URI uri = Activator.getURI(location); |
| 60 |
if (uri != null) |
| 61 |
sourceArtifactRepositories.add(RepositoryHelper.localRepoURIHelper(uri)); |
| 62 |
} |
| 63 |
|
| 64 |
public void addSourceArtifactRepository(URI location) { |
| 65 |
if (location != null) |
| 66 |
sourceArtifactRepositories.add(RepositoryHelper.localRepoURIHelper(location)); |
| 67 |
} |
| 68 |
|
| 69 |
public void setSourceIUs(List ius) { |
43 |
public void setSourceIUs(List ius) { |
| 70 |
sourceIUs = ius; |
44 |
sourceIUs = ius; |
| 71 |
} |
45 |
} |
| 72 |
|
46 |
|
| 73 |
protected void finalizeRepositories() throws ProvisionException { |
47 |
protected void finalizeRepositories() throws ProvisionException { |
| 74 |
IArtifactRepositoryManager artifactRepositoryManager = Activator.getArtifactRepositoryManager(); |
48 |
if (removeAddedRepositories) { |
| 75 |
for (Iterator iter = artifactReposToRemove.iterator(); iter.hasNext();) |
49 |
IArtifactRepositoryManager artifactRepositoryManager = Activator.getArtifactRepositoryManager(); |
| 76 |
artifactRepositoryManager.removeRepository((URI) iter.next()); |
50 |
for (Iterator iter = artifactReposToRemove.iterator(); iter.hasNext();) |
| 77 |
IMetadataRepositoryManager metadataRepositoryManager = Activator.getMetadataRepositoryManager(); |
51 |
artifactRepositoryManager.removeRepository((URI) iter.next()); |
| 78 |
for (Iterator iter = metadataReposToRemove.iterator(); iter.hasNext();) |
52 |
IMetadataRepositoryManager metadataRepositoryManager = Activator.getMetadataRepositoryManager(); |
| 79 |
metadataRepositoryManager.removeRepository((URI) iter.next()); |
53 |
for (Iterator iter = metadataReposToRemove.iterator(); iter.hasNext();) |
|
|
54 |
metadataRepositoryManager.removeRepository((URI) iter.next()); |
| 55 |
} |
| 80 |
} |
56 |
} |
| 81 |
|
57 |
|
| 82 |
public void initializeRepos(IProgressMonitor progress) throws ProvisionException { |
58 |
public void initializeRepos(IProgressMonitor progress) throws ProvisionException { |
| 83 |
IArtifactRepositoryManager artifactRepositoryManager = Activator.getArtifactRepositoryManager(); |
59 |
IArtifactRepositoryManager artifactRepositoryManager = Activator.getArtifactRepositoryManager(); |
| 84 |
if (sourceArtifactRepositories != null && !sourceArtifactRepositories.isEmpty()) { |
|
|
| 85 |
for (Iterator iter = sourceArtifactRepositories.iterator(); iter.hasNext();) { |
| 86 |
URI repoLocation = (URI) iter.next(); |
| 87 |
if (!artifactRepositoryManager.contains(repoLocation)) |
| 88 |
artifactReposToRemove.add(repoLocation); |
| 89 |
artifactRepositoryManager.loadRepository(repoLocation, 0, progress); |
| 90 |
} |
| 91 |
} |
| 92 |
|
| 93 |
IMetadataRepositoryManager metadataRepositoryManager = Activator.getMetadataRepositoryManager(); |
60 |
IMetadataRepositoryManager metadataRepositoryManager = Activator.getMetadataRepositoryManager(); |
| 94 |
if (sourceMetadataRepositories != null && !sourceMetadataRepositories.isEmpty()) { |
61 |
URI curLocation = null; |
| 95 |
for (Iterator iter = sourceMetadataRepositories.iterator(); iter.hasNext();) { |
62 |
try { |
| 96 |
URI repoLocation = (URI) iter.next(); |
63 |
for (Iterator iter = sourceRepositories.iterator(); iter.hasNext();) { |
| 97 |
if (!metadataRepositoryManager.contains(repoLocation)) |
64 |
RepositoryDescriptor repo = (RepositoryDescriptor) iter.next(); |
| 98 |
metadataReposToRemove.add(repoLocation); |
65 |
curLocation = repo.getRepoLocation(); |
| 99 |
metadataRepositoryManager.loadRepository(repoLocation, 0, progress); |
66 |
if (repo.isBoth()) { |
|
|
67 |
addRepository(artifactRepositoryManager, curLocation, 0, progress); |
| 68 |
addRepository(metadataRepositoryManager, curLocation, 0, progress); |
| 69 |
} else if (repo.isArtifact()) |
| 70 |
addRepository(artifactRepositoryManager, curLocation, 0, progress); |
| 71 |
else if (repo.isMetadata()) |
| 72 |
addRepository(metadataRepositoryManager, curLocation, 0, progress); |
| 73 |
else |
| 74 |
throw new ProvisionException(NLS.bind(Messages.unknown_repository_type, repo.getRepoLocation())); |
| 75 |
} |
| 76 |
} catch (ProvisionException e) { |
| 77 |
if (e.getCause() instanceof MalformedURLException) { |
| 78 |
throw new ProvisionException(NLS.bind(Messages.exception_invalidSource, curLocation), e); |
| 100 |
} |
79 |
} |
|
|
80 |
throw e; |
| 101 |
} |
81 |
} |
| 102 |
|
|
|
| 103 |
processDestinationRepos(artifactRepositoryManager, metadataRepositoryManager); |
82 |
processDestinationRepos(artifactRepositoryManager, metadataRepositoryManager); |
|
|
83 |
} |
| 104 |
|
84 |
|
|
|
85 |
//Helper to add a repository. It takes care of adding the repos to the deletion list and loading it |
| 86 |
protected IMetadataRepository addRepository(IMetadataRepositoryManager manager, URI location, int flags, IProgressMonitor monitor) throws ProvisionException { |
| 87 |
if (!manager.contains(location)) |
| 88 |
metadataReposToRemove.add(location); |
| 89 |
return manager.loadRepository(location, flags, monitor); |
| 90 |
} |
| 91 |
|
| 92 |
//Helper to add a repository. It takes care of adding the repos to the deletion list and loading it |
| 93 |
protected IArtifactRepository addRepository(IArtifactRepositoryManager manager, URI location, int flags, IProgressMonitor monitor) throws ProvisionException { |
| 94 |
if (!manager.contains(location)) |
| 95 |
artifactReposToRemove.add(location); |
| 96 |
return manager.loadRepository(location, flags, monitor); |
| 105 |
} |
97 |
} |
| 106 |
|
98 |
|
| 107 |
private void processDestinationRepos(IArtifactRepositoryManager artifactRepositoryManager, IMetadataRepositoryManager metadataRepositoryManager) throws ProvisionException { |
99 |
private void processDestinationRepos(IArtifactRepositoryManager artifactRepositoryManager, IMetadataRepositoryManager metadataRepositoryManager) throws ProvisionException { |
| 108 |
if (destinationRepos.size() != 2) { |
100 |
RepositoryDescriptor artifactRepoDescriptor = null; |
| 109 |
throw new ProvisionException("Too many or too few destination repositories."); |
101 |
RepositoryDescriptor metadataRepoDescriptor = null; |
|
|
102 |
|
| 103 |
Iterator iter = destinationRepos.iterator(); |
| 104 |
while (iter.hasNext() && (artifactRepoDescriptor == null || metadataRepoDescriptor == null)) { |
| 105 |
RepositoryDescriptor repo = (RepositoryDescriptor) iter.next(); |
| 106 |
if (repo.isArtifact() && artifactRepoDescriptor == null) |
| 107 |
artifactRepoDescriptor = repo; |
| 108 |
if (repo.isMetadata() && metadataRepoDescriptor == null) |
| 109 |
metadataRepoDescriptor = repo; |
| 110 |
} |
110 |
} |
| 111 |
RepositoryDescriptor artifactRepoDescriptor = ((RepositoryDescriptor) destinationRepos.get(0)).getKind() == IRepository.TYPE_ARTIFACT ? ((RepositoryDescriptor) destinationRepos.get(0)) : ((RepositoryDescriptor) destinationRepos.get(1)); |
111 |
|
| 112 |
RepositoryDescriptor metadataRepoDescriptor = ((RepositoryDescriptor) destinationRepos.get(0)).getKind() == IRepository.TYPE_METADATA ? ((RepositoryDescriptor) destinationRepos.get(0)) : ((RepositoryDescriptor) destinationRepos.get(1)); |
112 |
if (artifactRepoDescriptor != null) |
| 113 |
destinationArtifactRepository = initializeDestination(artifactRepoDescriptor, artifactRepositoryManager); |
113 |
destinationArtifactRepository = initializeDestination(artifactRepoDescriptor, artifactRepositoryManager); |
| 114 |
destinationMetadataRepository = initializeDestination(metadataRepoDescriptor, metadataRepositoryManager); |
114 |
if (metadataRepoDescriptor != null) |
| 115 |
} |
115 |
destinationMetadataRepository = initializeDestination(metadataRepoDescriptor, metadataRepositoryManager); |
| 116 |
|
116 |
|
| 117 |
private IMetadataRepository initializeDestination(RepositoryDescriptor toInit, IMetadataRepositoryManager mgr) throws ProvisionException { |
117 |
if (destinationMetadataRepository == null && destinationArtifactRepository == null) |
| 118 |
try { |
118 |
throw new ProvisionException(Messages.AbstractApplication_no_valid_destinations); |
| 119 |
if (!mgr.contains(toInit.getRepoLocation())) |
119 |
} |
| 120 |
metadataReposToRemove.add(toInit.getRepoLocation()); |
120 |
|
| 121 |
IMetadataRepository repository = mgr.loadRepository(toInit.getRepoLocation(), IRepositoryManager.REPOSITORY_HINT_MODIFIABLE, null); |
121 |
protected IMetadataRepository initializeDestination(RepositoryDescriptor toInit, IMetadataRepositoryManager mgr) throws ProvisionException { |
| 122 |
if (repository != null && repository.isModifiable()) { |
122 |
try { |
| 123 |
if (toInit.getName() != null) |
123 |
IMetadataRepository repository = addRepository(mgr, toInit.getRepoLocation(), IRepositoryManager.REPOSITORY_HINT_MODIFIABLE, null); |
| 124 |
repository.setName(toInit.getName()); |
124 |
if (initDestinationRepository(repository, toInit)) |
| 125 |
if (!toInit.isAppend()) |
|
|
| 126 |
repository.removeAll(); |
| 127 |
return repository; |
125 |
return repository; |
| 128 |
} |
|
|
| 129 |
} catch (ProvisionException e) { |
126 |
} catch (ProvisionException e) { |
| 130 |
//fall through and create a new repository below |
127 |
//fall through and create a new repository below |
| 131 |
} |
128 |
} |
|
Lines 133-183
Link Here
|
| 133 |
IMetadataRepository source = null; |
130 |
IMetadataRepository source = null; |
| 134 |
try { |
131 |
try { |
| 135 |
if (toInit.getFormat() != null) |
132 |
if (toInit.getFormat() != null) |
| 136 |
source = mgr.loadRepository(URIUtil.fromString(toInit.getFormat()), 0, null); |
133 |
source = mgr.loadRepository(toInit.getFormat(), 0, null); |
| 137 |
} catch (ProvisionException e) { |
134 |
} catch (ProvisionException e) { |
| 138 |
//Ignore. |
135 |
//Ignore. |
| 139 |
} catch (URISyntaxException e) { |
|
|
| 140 |
//Ignore |
| 141 |
} |
136 |
} |
| 142 |
//This code assumes source has been successfully loaded before this point |
137 |
//This code assumes source has been successfully loaded before this point |
| 143 |
//No existing repository; create a new repository at destinationLocation but with source's attributes. |
138 |
//No existing repository; create a new repository at destinationLocation but with source's attributes. |
| 144 |
IMetadataRepository result = mgr.createRepository(toInit.getRepoLocation(), toInit.getName() != null ? toInit.getName() : (source != null ? source.getName() : toInit.getRepoLocation().toString()), IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, source != null ? source.getProperties() : null); |
139 |
try { |
| 145 |
if (toInit.isCompressed() && !result.getProperties().containsKey(IRepository.PROP_COMPRESSED)) |
140 |
IMetadataRepository result = mgr.createRepository(toInit.getRepoLocation(), toInit.getName() != null ? toInit.getName() : (source != null ? source.getName() : toInit.getRepoLocation().toString()), IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, source != null ? source.getProperties() : null); |
| 146 |
result.setProperty(IRepository.PROP_COMPRESSED, "true"); //$NON-NLS-1$ |
141 |
if (toInit.isCompressed() && !result.getProperties().containsKey(IRepository.PROP_COMPRESSED)) |
| 147 |
return (IMetadataRepository) RepositoryHelper.validDestinationRepository(result); |
142 |
result.setProperty(IRepository.PROP_COMPRESSED, "true"); //$NON-NLS-1$ |
| 148 |
} |
143 |
return (IMetadataRepository) RepositoryHelper.validDestinationRepository(result); |
| 149 |
|
144 |
} catch (UnsupportedOperationException e) { |
| 150 |
private IArtifactRepository initializeDestination(RepositoryDescriptor toInit, IArtifactRepositoryManager mgr) throws ProvisionException { |
145 |
throw new ProvisionException(NLS.bind(Messages.exception_invalidDestination, toInit.getRepoLocation()), e.getCause()); |
| 151 |
try { |
146 |
} |
| 152 |
if (!mgr.contains(toInit.getRepoLocation())) |
147 |
} |
| 153 |
artifactReposToRemove.add(toInit.getRepoLocation()); |
148 |
|
| 154 |
IArtifactRepository repository = mgr.loadRepository(toInit.getRepoLocation(), IRepositoryManager.REPOSITORY_HINT_MODIFIABLE, null); |
149 |
protected IArtifactRepository initializeDestination(RepositoryDescriptor toInit, IArtifactRepositoryManager mgr) throws ProvisionException { |
| 155 |
if (repository != null && repository.isModifiable()) { |
150 |
try { |
| 156 |
if (toInit.getName() != null) |
151 |
IArtifactRepository repository = addRepository(mgr, toInit.getRepoLocation(), IRepositoryManager.REPOSITORY_HINT_MODIFIABLE, null); |
| 157 |
repository.setName(toInit.getName()); |
152 |
if (initDestinationRepository(repository, toInit)) |
| 158 |
if (!toInit.isAppend()) |
|
|
| 159 |
repository.removeAll(); |
| 160 |
return repository; |
153 |
return repository; |
| 161 |
} |
|
|
| 162 |
} catch (ProvisionException e) { |
154 |
} catch (ProvisionException e) { |
| 163 |
//fall through and create a new repository below |
155 |
//fall through and create a new repository below |
| 164 |
} |
156 |
} |
| 165 |
IArtifactRepository source = null; |
157 |
IArtifactRepository source = null; |
| 166 |
try { |
158 |
try { |
| 167 |
if (toInit.getFormat() != null) |
159 |
if (toInit.getFormat() != null) |
| 168 |
source = mgr.loadRepository(URIUtil.fromString(toInit.getFormat()), 0, null); |
160 |
source = mgr.loadRepository(toInit.getFormat(), 0, null); |
| 169 |
} catch (ProvisionException e) { |
161 |
} catch (ProvisionException e) { |
| 170 |
//Ignore. |
162 |
//Ignore. |
| 171 |
} catch (URISyntaxException e) { |
|
|
| 172 |
//Ignore |
| 173 |
} |
163 |
} |
| 174 |
//This code assumes source has been successfully loaded before this point |
164 |
//This code assumes source has been successfully loaded before this point |
| 175 |
//No existing repository; create a new repository at destinationLocation but with source's attributes. |
165 |
//No existing repository; create a new repository at destinationLocation but with source's attributes. |
| 176 |
// TODO for now create a Simple repo by default. |
166 |
// TODO for now create a Simple repo by default. |
| 177 |
IArtifactRepository result = mgr.createRepository(toInit.getRepoLocation(), toInit.getName() != null ? toInit.getName() : (source != null ? source.getName() : toInit.getRepoLocation().toString()), IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, source != null ? source.getProperties() : null); |
167 |
try { |
| 178 |
if (toInit.isCompressed() && !result.getProperties().containsKey(IRepository.PROP_COMPRESSED)) |
168 |
IArtifactRepository result = mgr.createRepository(toInit.getRepoLocation(), toInit.getName() != null ? toInit.getName() : (source != null ? source.getName() : toInit.getRepoLocation().toString()), IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, source != null ? source.getProperties() : null); |
| 179 |
result.setProperty(IRepository.PROP_COMPRESSED, "true"); //$NON-NLS-1$ |
169 |
if (toInit.isCompressed() && !result.getProperties().containsKey(IRepository.PROP_COMPRESSED)) |
| 180 |
return (IArtifactRepository) RepositoryHelper.validDestinationRepository(result); |
170 |
result.setProperty(IRepository.PROP_COMPRESSED, "true"); //$NON-NLS-1$ |
|
|
171 |
return (IArtifactRepository) RepositoryHelper.validDestinationRepository(result); |
| 172 |
} catch (UnsupportedOperationException e) { |
| 173 |
throw new ProvisionException(NLS.bind(Messages.exception_invalidDestination, toInit.getRepoLocation()), e.getCause()); |
| 174 |
} |
| 175 |
} |
| 176 |
|
| 177 |
protected boolean initDestinationRepository(IRepository repository, RepositoryDescriptor descriptor) { |
| 178 |
if (repository != null && repository.isModifiable()) { |
| 179 |
if (descriptor.getName() != null) |
| 180 |
repository.setName(descriptor.getName()); |
| 181 |
if (repository instanceof ICompositeRepository && !descriptor.isAppend()) |
| 182 |
((ICompositeRepository) repository).removeAllChildren(); |
| 183 |
else if (repository instanceof IMetadataRepository && !descriptor.isAppend()) |
| 184 |
((IMetadataRepository) repository).removeAll(); |
| 185 |
else if (repository instanceof IArtifactRepository && !descriptor.isAppend()) |
| 186 |
((IArtifactRepository) repository).removeAll(); |
| 187 |
return true; |
| 188 |
} |
| 189 |
return false; |
| 181 |
} |
190 |
} |
| 182 |
|
191 |
|
| 183 |
public IMetadataRepository getCompositeMetadataRepository() { |
192 |
public IMetadataRepository getCompositeMetadataRepository() { |
|
Lines 187-194
Link Here
|
| 187 |
} catch (URISyntaxException e) { |
196 |
} catch (URISyntaxException e) { |
| 188 |
//Can't happen |
197 |
//Can't happen |
| 189 |
} |
198 |
} |
| 190 |
for (Iterator iter = sourceMetadataRepositories.iterator(); iter.hasNext();) { |
199 |
for (Iterator iter = sourceRepositories.iterator(); iter.hasNext();) { |
| 191 |
compositeMetadataRepository.addChild((URI) iter.next()); |
200 |
RepositoryDescriptor repo = (RepositoryDescriptor) iter.next(); |
|
|
201 |
if (repo.isMetadata()) |
| 202 |
compositeMetadataRepository.addChild(repo.getRepoLocation()); |
| 192 |
} |
203 |
} |
| 193 |
} |
204 |
} |
| 194 |
return compositeMetadataRepository; |
205 |
return compositeMetadataRepository; |
|
Lines 197-216
Link Here
|
| 197 |
public IArtifactRepository getCompositeArtifactRepository() { |
208 |
public IArtifactRepository getCompositeArtifactRepository() { |
| 198 |
if (compositeArtifactRepository == null) { |
209 |
if (compositeArtifactRepository == null) { |
| 199 |
try { |
210 |
try { |
| 200 |
compositeArtifactRepository = new CompositeArtifactRepository(new URI("memory:/composite"), "parent metadata repo", null);//$NON-NLS-1$ //$NON-NLS-2$ |
211 |
compositeArtifactRepository = new CompositeArtifactRepository(new URI("memory:/composite"), "parent artifact repo", null);//$NON-NLS-1$ //$NON-NLS-2$ |
| 201 |
} catch (URISyntaxException e) { |
212 |
} catch (URISyntaxException e) { |
| 202 |
//Can't happen |
213 |
//Can't happen |
| 203 |
} |
214 |
} |
| 204 |
for (Iterator iter = sourceArtifactRepositories.iterator(); iter.hasNext();) { |
215 |
for (Iterator iter = sourceRepositories.iterator(); iter.hasNext();) { |
| 205 |
compositeArtifactRepository.addChild((URI) iter.next()); |
216 |
RepositoryDescriptor repo = (RepositoryDescriptor) iter.next(); |
|
|
217 |
if (repo.isArtifact()) |
| 218 |
compositeArtifactRepository.addChild(repo.getRepoLocation()); |
| 206 |
} |
219 |
} |
| 207 |
} |
220 |
} |
| 208 |
return compositeArtifactRepository; |
221 |
return compositeArtifactRepository; |
| 209 |
} |
222 |
} |
| 210 |
|
223 |
|
|
|
224 |
protected boolean hasArtifactSources() { |
| 225 |
return !((ICompositeRepository) getCompositeArtifactRepository()).getChildren().isEmpty(); |
| 226 |
} |
| 227 |
|
| 228 |
protected boolean hasMetadataSources() { |
| 229 |
return !((ICompositeRepository) getCompositeMetadataRepository()).getChildren().isEmpty(); |
| 230 |
} |
| 231 |
|
| 211 |
public abstract IStatus run(IProgressMonitor monitor) throws ProvisionException; |
232 |
public abstract IStatus run(IProgressMonitor monitor) throws ProvisionException; |
| 212 |
|
233 |
|
| 213 |
public void addDestination(RepositoryDescriptor descriptor) { |
234 |
public void addDestination(RepositoryDescriptor descriptor) { |
| 214 |
destinationRepos.add(descriptor); |
235 |
destinationRepos.add(descriptor); |
| 215 |
} |
236 |
} |
|
|
237 |
|
| 238 |
public void addSource(RepositoryDescriptor repo) { |
| 239 |
sourceRepositories.add(repo); |
| 240 |
} |
| 216 |
} |
241 |
} |