Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Bull2011-04-14 18:08:18 -0400
committerIan Bull2011-04-14 18:08:18 -0400
commit84e7608273c259242bd2931661f6ffe929f0ceaf (patch)
treea8f88b82abd6fb27578919be5a5e53447c42f495 /bundles/org.eclipse.equinox.p2.artifact.repository
parent5bbf078c8a3de7838200534b38316f5b147be00a (diff)
downloadrt.equinox.p2-84e7608273c259242bd2931661f6ffe929f0ceaf.tar.gz
rt.equinox.p2-84e7608273c259242bd2931661f6ffe929f0ceaf.tar.xz
rt.equinox.p2-84e7608273c259242bd2931661f6ffe929f0ceaf.zip
NEW - bug 342902: blobstore name cannot be set
https://bugs.eclipse.org/bugs/show_bug.cgi?id=342902
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.artifact.repository')
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
index 469e1255b..e0d96bfdc 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
@@ -74,6 +74,11 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
private Location lockLocation = null;
/**
+ * Allows an artifact repository to set the name of its blobstore.
+ */
+ public static final String PROP_BLOBSTORE_NAME = "p2.blobstore.name"; //$NON-NLS-1$
+
+ /**
* Does this instance of the repository currently hold a lock
*/
private boolean holdsLock = false;
@@ -261,8 +266,8 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
return URIUtil.append(base, CONTENT_FILENAME + extension);
}
- public static URI getBlobStoreLocation(URI base) {
- return URIUtil.append(base, BLOBSTORE);
+ public static URI getBlobStoreLocation(URI base, String suffix) {
+ return URIUtil.append(base, suffix);
}
/*
@@ -918,7 +923,8 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
private synchronized void initializeAfterLoad(URI repoLocation, boolean updateTimestamp) {
setLocation(repoLocation);
- blobStore = new BlobStore(getBlobStoreLocation(repoLocation), 128);
+ String suffix = getBlobStoreName(BLOBSTORE);
+ blobStore = new BlobStore(getBlobStoreLocation(repoLocation, suffix), 128);
initializeMapper();
for (SimpleArtifactDescriptor desc : artifactDescriptors)
desc.setRepository(this);
@@ -926,6 +932,14 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
updateTimestamp();
}
+ private String getBlobStoreName(String defaultValue) {
+ String value = getProperty(PROP_BLOBSTORE_NAME);
+ if (value == null || value.length() == 0) {
+ return defaultValue;
+ }
+ return value;
+ }
+
private synchronized void initializeMapper() {
mapper = new Mapper();
mapper.initialize(Activator.getContext(), mappingRules);

Back to the top