Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2010-04-06 19:20:40 -0400
committerrelves2010-04-06 19:20:40 -0400
commitb3fd22db7d35ec7046a8d63d25f37104ebf78aff (patch)
treea3d5b984b675fc6e623eb7ec4b3c15778251bfa8 /org.eclipse.mylyn.oslc.core
parent4a1ad6400d7a534844e137e3796acc0b3f5c2dd3 (diff)
downloadorg.eclipse.mylyn.tasks-b3fd22db7d35ec7046a8d63d25f37104ebf78aff.tar.gz
org.eclipse.mylyn.tasks-b3fd22db7d35ec7046a8d63d25f37104ebf78aff.tar.xz
org.eclipse.mylyn.tasks-b3fd22db7d35ec7046a8d63d25f37104ebf78aff.zip
NEW - bug 303015: [oslc] implement boiler plate oslc connector
https://bugs.eclipse.org/bugs/show_bug.cgi?id=303015
Diffstat (limited to 'org.eclipse.mylyn.oslc.core')
-rw-r--r--org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/client/AbstractOslcClient.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/client/AbstractOslcClient.java b/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/client/AbstractOslcClient.java
index 2c1081cf9..a85005218 100644
--- a/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/client/AbstractOslcClient.java
+++ b/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/client/AbstractOslcClient.java
@@ -14,6 +14,7 @@ package org.eclipse.mylyn.internal.oslc.core.client;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
@@ -378,8 +379,13 @@ public abstract class AbstractOslcClient {
return configuration;
}
- public Collection<AbstractChangeRequest> performQuery(String queryUrl, IProgressMonitor monitor)
- throws CoreException {
+ public Collection<AbstractChangeRequest> performQuery(String query, IProgressMonitor monitor) throws CoreException {
+ try {
+ query = URLEncoder.encode(query, "UTF-8"); //$NON-NLS-1$
+ } catch (UnsupportedEncodingException e) {
+ query = URLEncoder.encode(query);
+ }
+ final String requestUrl = getConfiguration(monitor).getSimpleQueryUrl() + "?oslc_cm.query=" + query; //$NON-NLS-1$
RequestHandler<Collection<AbstractChangeRequest>> handler = new RequestHandler<Collection<AbstractChangeRequest>>(
"Performing Query") { //$NON-NLS-1$
@@ -393,7 +399,7 @@ public abstract class AbstractOslcClient {
}
};
- return executeMethod(createGetMethod(queryUrl), handler, monitor);
+ return executeMethod(createGetMethod(requestUrl), handler, monitor);
}

Back to the top