Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDJ Houghton2008-04-18 17:35:35 -0400
committerDJ Houghton2008-04-18 17:35:35 -0400
commit03b9c4456816b025f356a8f5240c105cf67a488d (patch)
tree13905acd3e03256ba3fb3110d4a76acd4f6f9249 /bundles/org.eclipse.equinox.p2.directorywatcher
parentce55ebb1a9515133fda95b447f699847e87c1d4c (diff)
downloadrt.equinox.p2-03b9c4456816b025f356a8f5240c105cf67a488d.tar.gz
rt.equinox.p2-03b9c4456816b025f356a8f5240c105cf67a488d.tar.xz
rt.equinox.p2-03b9c4456816b025f356a8f5240c105cf67a488d.zip
Bug 227817 - Should be able to pass in properties at repository creation time
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.directorywatcher')
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java23
1 files changed, 11 insertions, 12 deletions
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
index 3cfd88484..da78ce5d4 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
@@ -145,15 +145,14 @@ public class RepositoryListener extends DirectoryChangeListener {
//fall through and create a new repository
}
try {
- IArtifactRepository repository;
+ String name = repositoryName;
+ Map properties = new HashMap(1);
if (hidden) {
- repository = manager.createRepository(stateDirURL, "artifact listener " + repositoryName, IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY); //$NON-NLS-1$
- manager.addRepository(repository.getLocation());
- repository.setProperty(IRepository.PROP_SYSTEM, Boolean.TRUE.toString());
- } else {
- repository = manager.createRepository(stateDirURL, repositoryName, IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY);
- manager.addRepository(repository.getLocation());
+ properties.put(IRepository.PROP_SYSTEM, Boolean.TRUE.toString());
+ name = "artifact listener " + repositoryName; //$NON-NLS-1$
}
+ IArtifactRepository repository = manager.createRepository(stateDirURL, name, IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
+ manager.addRepository(repository.getLocation());
return repository;
} catch (ProvisionException e) {
LogHelper.log(e);
@@ -178,13 +177,13 @@ public class RepositoryListener extends DirectoryChangeListener {
} catch (ProvisionException e) {
//fall through and create new repository
}
- IMetadataRepository repository;
+ String name = repositoryName;
+ Map properties = new HashMap(1);
if (hidden) {
- repository = manager.createRepository(stateDirURL, "Metadata listener " + repositoryName, IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY); //$NON-NLS-1$
- repository.setProperty(IRepository.PROP_SYSTEM, Boolean.TRUE.toString());
- } else {
- repository = manager.createRepository(stateDirURL, repositoryName, IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY);
+ properties.put(IRepository.PROP_SYSTEM, Boolean.TRUE.toString());
+ name = "metadata listener " + repositoryName; //$NON-NLS-1$
}
+ IMetadataRepository repository = manager.createRepository(stateDirURL, name, IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
manager.addRepository(stateDirURL);
return repository;
} catch (ProvisionException e) {

Back to the top