1 /*******************************************************************************
\r
2 * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.
\r
3 * All rights reserved. This program and the accompanying materials
\r
4 * are made available under the terms of the Eclipse Public License v1.0
\r
5 * which accompanies this distribution, and is available at
\r
6 * http://www.eclipse.org/legal/epl-v10.html
\r
9 * VTT Technical Research Centre of Finland - initial API and implementation
\r
10 *******************************************************************************/
\r
11 package org.simantics.project.management;
\r
13 import java.io.File;
\r
14 import java.io.IOException;
\r
15 import java.io.InputStream;
\r
16 import java.net.URI;
\r
17 import java.util.ArrayList;
\r
18 import java.util.Collection;
\r
19 import java.util.Collections;
\r
20 import java.util.HashMap;
\r
21 import java.util.HashSet;
\r
22 import java.util.List;
\r
23 import java.util.Map;
\r
24 import java.util.Set;
\r
25 import java.util.jar.Manifest;
\r
27 import org.eclipse.core.runtime.IPath;
\r
28 import org.eclipse.core.runtime.IProgressMonitor;
\r
29 import org.eclipse.core.runtime.IStatus;
\r
30 import org.eclipse.core.runtime.Path;
\r
31 import org.eclipse.core.runtime.Platform;
\r
32 import org.eclipse.core.runtime.Status;
\r
33 import org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository;
\r
34 import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository;
\r
35 import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepositoryFactory;
\r
36 import org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository;
\r
37 import org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository;
\r
38 import org.eclipse.equinox.internal.p2.metadata.repository.SimpleMetadataRepositoryFactory;
\r
39 import org.eclipse.equinox.p2.core.IProvisioningAgent;
\r
40 import org.eclipse.equinox.p2.core.ProvisionException;
\r
41 import org.eclipse.equinox.p2.internal.repository.mirroring.Mirroring;
\r
42 import org.eclipse.equinox.p2.metadata.IArtifactKey;
\r
43 import org.eclipse.equinox.p2.metadata.IInstallableUnit;
\r
44 import org.eclipse.equinox.p2.metadata.IVersionedId;
\r
45 import org.eclipse.equinox.p2.metadata.VersionedId;
\r
46 import org.eclipse.equinox.p2.query.IQuery;
\r
47 import org.eclipse.equinox.p2.query.IQueryResult;
\r
48 import org.eclipse.equinox.p2.query.QueryUtil;
\r
49 import org.eclipse.equinox.p2.repository.artifact.ArtifactKeyQuery;
\r
50 import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
\r
51 import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
\r
52 import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
\r
53 import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
\r
54 import org.simantics.graph.db.TransferableGraphException;
\r
55 import org.simantics.graph.query.Graphs;
\r
56 import org.simantics.graph.query.IGraph;
\r
57 import org.simantics.graph.query.Paths;
\r
58 import org.simantics.graph.query.Res;
\r
59 import org.simantics.graph.query.UriUtils;
\r
60 import org.simantics.graph.representation.TransferableGraph1;
\r
61 import org.simantics.scl.reflection.OntologyVersions;
\r
62 import org.simantics.utils.FileUtils;
\r
65 * Bundlepool is a repository of artifacts and installable units.
\r
67 * @author Toni Kalajainen <toni.kalajainen@vtt.fi>
\r
69 @SuppressWarnings("restriction")
\r
70 public class BundlePool {
\r
72 /** Application default pool. It is located at "workspace/bundlepool" */
\r
73 static BundlePool DEFAULT;
\r
75 IMetadataRepository metadataRepository;
\r
76 IArtifactRepository artifactRepository;
\r
77 IProvisioningAgent metadataAgent;
\r
78 IProvisioningAgent artifactAgent;
\r
79 URI metadataAgentLocation;
\r
80 URI artifactAgentLocation;
\r
82 List<BundleInfo> userInstallables;
\r
84 /** All features that were discovered in the repository */
\r
85 Set<FeatureInfo> projectFeatures = new HashSet<FeatureInfo>();
\r
88 * Get SPM Bundle Pool
\r
90 * @return SPM Bundle Pool
\r
92 public synchronized static BundlePool getDefault() {
\r
93 if (DEFAULT == null) {
\r
95 IPath path = Platform.getLocation().append("bundlepool");
\r
96 URI metadataRepositoryLocation = path.toFile().toURI();
\r
97 URI artifactRepositoryLocation = path.toFile().toURI();
\r
98 IProvisioningAgent agent = P2Util.createAgent( path );
\r
99 DEFAULT = new BundlePool(metadataRepositoryLocation, artifactRepositoryLocation, agent);
\r
100 } catch (ProvisionException e) {
\r
102 throw new RuntimeException(e);
\r
109 * Create bundle pool in a directory on a local hard drive.
\r
110 * This location will contain metadata repository, artifact repository and
\r
111 * P2 workarea (Agent).
\r
114 * @return bundle pool
\r
116 public static BundlePool createAt(File location) {
\r
118 File canonicalLocation = location.getCanonicalFile();
\r
119 URI metadataRepositoryLocation = canonicalLocation.toURI();
\r
120 URI artifactRepositoryLocation = canonicalLocation.toURI();
\r
121 IPath agentLocation = new Path( canonicalLocation.toString() );
\r
122 IProvisioningAgent agent = P2Util.createAgent( agentLocation );
\r
123 return new BundlePool(metadataRepositoryLocation, artifactRepositoryLocation, agent);
\r
124 } catch (IOException e) {
\r
125 throw new RuntimeException(e);
\r
126 } catch (org.eclipse.equinox.p2.core.ProvisionException e) {
\r
127 throw new RuntimeException(e);
\r
132 public BundlePool(URI metadataRepositoryLocation, URI artifactRepositoryLocation, IProvisioningAgent agent) throws ProvisionException {
\r
134 this.metadataAgent = agent;
\r
135 this.artifactAgent = agent;
\r
137 SimpleMetadataRepositoryFactory metRepFactory = new SimpleMetadataRepositoryFactory();
\r
138 metRepFactory.setAgent( metadataAgent );
\r
140 metadataRepository = metRepFactory.load(metadataRepositoryLocation, 0, null);
\r
141 } catch (org.eclipse.equinox.p2.core.ProvisionException pe) {
\r
142 new File(metadataRepositoryLocation).mkdirs();
\r
143 Map<String, String> repoProperties = new HashMap<String, String>();
\r
144 metadataRepository = metRepFactory.create(metadataRepositoryLocation, "SPM Bundle Pool", "file", repoProperties);
\r
147 // IMetadataRepository metadataRepository = new LocalMetadataRepository( agent, repositoryLocation, "My Metadata Repository", Collections.EMPTY_MAP );
\r
148 // IMetadataRepository metadataRepository = getMetadataRepository(agent, repositoryLocation);
\r
150 // IArtifactRepository artifactRepository = new SimpleArtifactRepositoryFactory().create(repositoryLocation, "Sample Artifact Repository", ArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, Collections.EMPTY_MAP);
\r
151 // SimpleArtifactRepository artifactRepository = new SimpleArtifactRepository( agent, "My Simple Artifact Repository", repositoryLocation, Collections.EMPTY_MAP);
\r
152 SimpleArtifactRepositoryFactory artRepFactory = new SimpleArtifactRepositoryFactory();
\r
153 artRepFactory.setAgent( artifactAgent );
\r
156 artifactRepository = artRepFactory.load(artifactRepositoryLocation, 0, null);
\r
157 } catch (org.eclipse.equinox.p2.core.ProvisionException pe) {
\r
158 new File(artifactRepositoryLocation).mkdirs();
\r
159 Map<String, String> repoProperties = new HashMap<String, String>();
\r
160 artifactRepository = artRepFactory.create(artifactRepositoryLocation, "SPM Bundle Pool", "file", repoProperties);
\r
166 public BundlePool(IMetadataRepository metadataRepository, IArtifactRepository artifactRepository) throws ProvisionException {
\r
167 this.metadataRepository = metadataRepository;
\r
168 this.artifactRepository = artifactRepository;
\r
169 this.metadataAgent = metadataRepository.getProvisioningAgent();
\r
170 this.artifactAgent = artifactRepository.getProvisioningAgent();
\r
175 * Init prepares with the following actions:
\r
176 * o loads transferable graphs
\r
177 * o discovers Features and collects Feature URIs, Artifacts and Installable Units
\r
179 * @throws ProvisionException
\r
181 protected void init() throws ProvisionException {
\r
183 projectFeatures.clear();
\r
185 ArrayList<TransferableGraph1> platformTGs = new ArrayList<TransferableGraph1>();
\r
187 for (IArtifactKey key : getAllArtifactKeys()) {
\r
188 boolean hasGraph = ProvisioningUtil.hasFile(artifactRepository, key, "graph.tg");
\r
189 if (!hasGraph) continue;
\r
192 TransferableGraph1 graph = ProvisioningUtil.getTransferableGraph(artifactRepository, key);
\r
193 platformTGs.add(graph);
\r
196 // Create new project, use all features available in Platform
\r
197 final List<String> poolFeatures = new ArrayList<String>();
\r
199 // Convert graph instances
\r
200 GraphBundleEx l0 = getLayer0();
\r
201 String l0v = l0.getMajor() + "." + l0.getMinor();
\r
202 IGraph graph = Graphs.createGraph(new Paths(l0v), platformTGs);
\r
204 for(Res feature : graph.getInstances(UriUtils.uriToPath(OntologyVersions.getInstance().currentVersion("http://www.simantics.org/Project-0.0/Feature" )))) {
\r
205 poolFeatures.add( feature.toString() );
\r
208 } catch (TransferableGraphException e) {
\r
209 throw new ProvisionException("Problem", e);
\r
210 } catch (IOException e) {
\r
211 throw new ProvisionException("Failed to read graph.tg", e);
\r
215 public IMetadataRepository getMetadataRepository() {
\r
216 return metadataRepository;
\r
219 public IArtifactRepository getArtifactRepository() {
\r
220 return artifactRepository;
\r
223 public IArtifactKey[] getAllArtifactKeys() {
\r
224 return artifactRepository.query( ArtifactKeyQuery.ALL_KEYS, null ).toArray( IArtifactKey.class );
\r
227 public GraphBundleEx getLayer0() throws ProvisionException, TransferableGraphException {
\r
228 IVersionedId vid = VersionedId.parse("org.simantics.layer0");
\r
229 Set<IInstallableUnit> result = metadataRepository.query( QueryUtil.createLatestQuery( QueryUtil.createIUQuery(vid) ), null).toSet();
\r
230 if (result.isEmpty()) throw new RuntimeException("Unexpectedly got no IU for "+vid);
\r
231 if (result.size()>1) throw new RuntimeException("Unexpectedly got more than one latest IU for "+vid);
\r
232 IInstallableUnit iu = result.iterator().next();
\r
233 IArtifactKey key = toSingleArtifact(iu);
\r
234 TransferableGraph1 graph = getTransferableGraph( key );
\r
235 return new GraphBundleEx( "Layer0", graph, key);
\r
238 public TransferableGraph1 getTransferableGraph(IArtifactKey artifactKey) throws ProvisionException, TransferableGraphException {
\r
239 return ProvisioningUtil.getTransferableGraph( artifactRepository, artifactKey);
\r
245 * Get all features.
\r
247 * @param a list of features
\r
248 * @throws ProvisionException
\r
250 public void getFeatures(List<BundleInfo> features) throws ProvisionException {
\r
251 IMetadataRepository metadataRepository = getMetadataRepository();
\r
253 Collection<IInstallableUnit> ius = ProvisioningUtil.getInstallableUnits(metadataRepository);
\r
254 for (IInstallableUnit iu : ius) {
\r
255 if (ProvisioningUtil.isGroup(iu)) {
\r
256 // if (P2Util.isFeature(iu)) {
\r
257 BundleInfo b = BundleInfo.read(iu);
\r
266 * @param id bundle id
\r
267 * @return bundle info
\r
269 public BundleInfo getBundleInfo(String id) {
\r
270 IQuery<IInstallableUnit> query = QueryUtil.createLatestQuery( QueryUtil.createIUQuery(id) );
\r
271 IQueryResult<IInstallableUnit> queryResult = metadataRepository.query(query, null);
\r
272 IInstallableUnit[] array = queryResult.toArray( IInstallableUnit.class );
\r
273 for (IInstallableUnit iu : array) {
\r
274 BundleInfo bi = BundleInfo.read(iu);
\r
281 * Get the features that visible for the end-user.
\r
282 * User installable features are configured in Simantics manifest files
\r
283 * (META-INF/SIMANTICS.MF as Simantics-Features-Bundle -property)
\r
286 * @throws IOException
\r
288 // public void getUserInstallableFeatures(Collection<BundleInfo> result) throws IOException {
\r
289 // ArrayList<String> ids = new ArrayList<String>();
\r
290 // ProvisioningUtil.getUserInstallables(artifactRepository, ids);
\r
291 // for (String id : ids) {
\r
292 // BundleInfo bi = getBundleInfo(id);
\r
293 // if (bi != null) result.add( bi );
\r
295 // // Add workspace bundle
\r
296 // BundleInfo bi = getBundleInfo( "org.simantics.workbench.product" );
\r
297 // if (bi != null) result.add( bi );
\r
303 * @param a list of features
\r
304 * @throws ProvisionException
\r
306 // public void getInstallableFeatures(List<BundleInfo> features) throws ProvisionException {
\r
307 // IMetadataRepository metadataRepository = getMetadataRepository();
\r
309 // Collection<IInstallableUnit> ius = ProvisioningUtil.getInstallableUnits(metadataRepository);
\r
310 // for (IInstallableUnit iu : ius) {
\r
311 // if (ProvisioningUtil.isGroup(iu)) {
\r
312 //// if (P2Util.isFeature(iu)) {
\r
313 // BundleInfo b = BundleInfo.read(iu);
\r
314 // features.add( b );
\r
320 * Mirror source locations to the bundle pool.
\r
323 * @param sourceLocations
\r
325 * @throws ProvisionException
\r
327 public IStatus download(IProgressMonitor monitor, URI[] sourceLocations) throws ProvisionException {
\r
329 monitor.beginTask("Synchronizing Local repository with web repositories", 10);
\r
331 @SuppressWarnings("unused")
\r
332 IMetadataRepositoryManager metaRepoMgr = (IMetadataRepositoryManager) metadataAgent.getService(IMetadataRepositoryManager.SERVICE_NAME);
\r
333 @SuppressWarnings("unused")
\r
334 IArtifactRepositoryManager artsRepoMgr = (IArtifactRepositoryManager) artifactAgent.getService(IArtifactRepositoryManager.SERVICE_NAME);
\r
337 // Create dest repos
\r
338 monitor.setTaskName("Setting up local metadata repository");
\r
339 LocalMetadataRepository dstMetaRepo = (LocalMetadataRepository) metadataRepository;
\r
342 monitor.setTaskName("Setting up local artifact repository");
\r
343 SimpleArtifactRepository dstArtsRepo = (SimpleArtifactRepository) artifactRepository;
\r
346 // Create a source repos
\r
347 monitor.setTaskName("Setting up remote artifact repository");
\r
348 CompositeArtifactRepository srcArtsRepo = CompositeArtifactRepository.createMemoryComposite( metadataAgent /* ? */ );
\r
349 for (URI uri : sourceLocations) srcArtsRepo.addChild(uri);
\r
352 monitor.setTaskName("Setting up remote metadata repository");
\r
353 CompositeMetadataRepository srcMetaRepo = CompositeMetadataRepository.createMemoryComposite( artifactAgent /* ? */ );
\r
354 for (URI uri : sourceLocations) srcMetaRepo.addChild(uri);
\r
357 monitor.setTaskName("Retrieving Installable Units");
\r
358 @SuppressWarnings("unused")
\r
359 Collection<IInstallableUnit> ius = ProvisioningUtil.getInstallableUnits(srcMetaRepo);
\r
362 monitor.setTaskName("Mirroring Metadata");
\r
363 // Get all IUs from source
\r
364 IQueryResult<IInstallableUnit> allIUs = srcMetaRepo.query(QueryUtil.createIUAnyQuery(), monitor);
\r
365 // Put the IUs to dst
\r
366 dstMetaRepo.addInstallableUnits(allIUs.toUnmodifiableSet());
\r
367 dstMetaRepo.addReferences(srcMetaRepo.getReferences());
\r
370 monitor.setTaskName("Mirroring Artifacts");
\r
372 boolean compare = false;
\r
373 boolean failOnError = true;
\r
374 //boolean raw = true;
\r
375 boolean verbose = false;
\r
376 boolean validate = false;
\r
377 //boolean mirrorReferences = false;
\r
378 String comparatorID = "";
\r
380 Mirroring mirror = new Mirroring(srcArtsRepo, dstArtsRepo, false);
\r
381 mirror.setCompare(compare);
\r
382 mirror.setComparatorId(comparatorID);
\r
383 // mirror.setBaseline(null);
\r
384 mirror.setValidate(validate);
\r
385 // mirror.setCompareExclusions();
\r
387 IStatus result = mirror.run(failOnError, verbose);
\r
388 if (result.getException()!=null)
\r
389 throw new ProvisionException(result);
\r
394 } catch (IllegalArgumentException iae) {
\r
395 return new Status(IStatus.ERROR, "org.simantics.project", iae.getMessage(), iae);
\r
399 public IInstallableUnit toSingleInstallableUnit(IVersionedId id) throws ProvisionException {
\r
400 Set<IInstallableUnit> result = metadataRepository.query( QueryUtil.createIUQuery(id), null).toSet();
\r
401 if (result.size() != 1) throw new RuntimeException("Unexpectedly got more than one latest IU for "+id);
\r
402 return result.iterator().next();
\r
405 public IArtifactKey toSingleArtifact(IVersionedId id) throws ProvisionException {
\r
406 IInstallableUnit iu = toSingleInstallableUnit(id);
\r
407 if (iu.getArtifacts().size() != 1) throw new RuntimeException("Unexpectedly got more than one artifact for ");
\r
408 return iu.getArtifacts().iterator().next();
\r
412 * Get file from an artifact.
\r
416 * @return inputstream or <tt>null</tt>. Inputstream must be closed.
\r
417 * @throws IOException
\r
419 public InputStream getFile(IArtifactKey key, String filename) throws IOException {
\r
420 return ProvisioningUtil.getFile(artifactRepository, key, filename);
\r
424 * Checks whether there exists a file in an artifact
\r
428 * @return true file exists in the artifact
\r
429 * @throws IOException
\r
431 public boolean hasFile(IArtifactKey key, String filename) throws IOException {
\r
432 return ProvisioningUtil.hasFile(artifactRepository, key, filename);
\r
436 * Get META-INF/MANIFEST.MF
\r
438 * @param repo artifact repo
\r
439 * @param key key to artifact
\r
440 * @return manifest or null
\r
441 * @throws IOException
\r
443 public Manifest getManifest(IArtifactKey key) throws IOException {
\r
444 return ProvisioningUtil.getManifest(artifactRepository, key);
\r
448 * Get META-INF/SIMANTICS.MF
\r
450 * @param repo artifact repo
\r
451 * @param key key to artifact
\r
452 * @return manifest or null
\r
453 * @throws IOException
\r
455 public Manifest getSimanticsManifest(IArtifactKey key) throws IOException {
\r
456 return ProvisioningUtil.getManifest(artifactRepository, key);
\r
460 * Get list of user installable bundles
\r
463 * @throws IOException
\r
465 public void getUserInstallables(List<BundleInfo> result) throws IOException {
\r
466 if (userInstallables==null) {
\r
467 userInstallables = new ArrayList<BundleInfo>();
\r
469 List<String> topLevelBundles = new ArrayList<String>();
\r
470 ProvisioningUtil.getUserInstallables(artifactRepository, topLevelBundles);
\r
472 for (String bundleId : topLevelBundles) {
\r
473 IInstallableUnit ius[] = metadataRepository.query( QueryUtil.createIUQuery(bundleId) , null).toArray( IInstallableUnit.class );
\r
474 for (IInstallableUnit iu : ius) {
\r
475 userInstallables.add( BundleInfo.read(iu) );
\r
480 result.addAll(userInstallables);
\r
492 // * Get graph bundles
\r
494 // * @param list to be populated with graph bundle ids
\r
495 // * @throws ProvisionException
\r
496 // * @throws IOException
\r
498 // public void getGraphs(List<BundleInfo> graphs) throws ProvisionException, IOException {
\r
499 // Collection<IInstallableUnit> ius = ProvisioningUtil.getInstallableUnits(metadataRepository);
\r
500 // for (IInstallableUnit iu : ius) {
\r
501 // if (isGraph(iu)) {
\r
502 // BundleInfo b = BundleInfo.read(iu);
\r
503 // graphs.add( b );
\r
509 * Get graph bundles
\r
511 * @param list to be populated with graph bundle ids
\r
512 * @throws ProvisionException
\r
513 * @throws IOException
\r
514 * @throws TransferableGraphException
\r
516 public void getGraphBundles(List<GraphBundleEx> graphs) throws ProvisionException, IOException, TransferableGraphException {
\r
517 Collection<IInstallableUnit> ius = ProvisioningUtil.getInstallableUnits(metadataRepository);
\r
518 for (IInstallableUnit iu : ius) {
\r
519 for (IArtifactKey key : iu.getArtifacts()) {
\r
520 if (!ProvisioningUtil.isGraphArtifact(artifactRepository, key)) continue;
\r
521 TransferableGraph1 tg = ProvisioningUtil.getTransferableGraph( artifactRepository, key );
\r
522 GraphBundleEx b = new GraphBundleEx(iu.getId(), tg, key);
\r
529 * Get a list of all features. Features are uris, they are versionless.
\r
531 * @throws TransferableGraphException
\r
532 * @throws IOException
\r
534 public Set<FeatureInfo> getFeatures() throws IOException, TransferableGraphException {
\r
536 HashSet<FeatureInfo> result = new HashSet<FeatureInfo>();
\r
537 Collection<IInstallableUnit> ius = ProvisioningUtil.getInstallableUnits(metadataRepository);
\r
538 for (IInstallableUnit iu : ius) {
\r
539 for (IArtifactKey key : iu.getArtifacts()) {
\r
540 if (!ProvisioningUtil.isGraphArtifact(artifactRepository, key)) continue;
\r
541 TransferableGraph1 tg = ProvisioningUtil.getTransferableGraph( artifactRepository, key );
\r
542 IGraph g = Graphs.createGraph(tg);
\r
544 Res PublishedProjectFeatures = UriUtils.uriToPath( ProjectResource.URIs.PublishedProjectFeatures );
\r
545 Path HasFeature = UriUtils.uriToPath( ProjectResource.URIs.HasFeature );
\r
546 for(Res feature : g.getObjects(PublishedProjectFeatures, HasFeature)) {
\r
547 String uri = feature.toString();
\r
548 String name = feature instanceof PathChild ? ((PathChild)feature).name : uri;
\r
550 FeatureInfo fi = new FeatureInfo(name, uri, null, null);
\r
558 return Collections.emptySet();
\r
562 * For a set of extact feature ids (id_version), find the set of graph bundles
\r
563 * required in the database.
\r
565 * @param featureIds feature
\r
566 * @return graph bundles
\r
568 public Set<IVersionedId> getRequiredGraphBundles(Collection<IVersionedId> featureIds) {
\r
574 * Checks whether artifact is a graph bundle.
\r
576 * @param key key to artifact
\r
577 * @return <code>true</code> if is a graph bundle
\r
578 * @throws IOException
\r
580 public boolean isGraphArtifact(IArtifactKey key) throws IOException {
\r
581 return ProvisioningUtil.isGraphArtifact(artifactRepository, key);
\r
585 * Checks wheter iu is graph
\r
589 * @throws IOException
\r
591 public boolean isGraph(IInstallableUnit iu) throws IOException {
\r
592 return ProvisioningUtil.isGraph(iu, metadataRepository, artifactRepository);
\r
596 * Delete default repositories located in /P2 folder
\r
597 * @throws IOException
\r
599 public void delete() throws IOException {
\r
600 File location1 = new File(metadataAgentLocation);
\r
601 File location2 = new File(artifactAgentLocation);
\r
602 File location3 = new File(metadataRepository.getLocation());
\r
603 File location4 = new File(artifactRepository.getLocation());
\r
604 FileUtils.deleteDir(location1);
\r
605 FileUtils.deleteDir(location2);
\r
606 FileUtils.deleteDir(location3);
\r
607 FileUtils.deleteDir(location4);
\r
608 location1.mkdirs();
\r
609 location2.mkdirs();
\r
610 location3.mkdirs();
\r
611 location4.mkdirs();
\r