summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Trutz2011-05-18 00:50:21 (EDT)
committer Christian Trutz2011-05-18 00:50:21 (EDT)
commitf9ee53eab7c4a16ef938f32517c1c5c59834f65e (patch)
treed2f7d348b2db944a0b03b3027a5249e277408f26
parenta4d4465d80c4b9141da2d0ea89c338a288664d28 (diff)
downloadegit-github-f9ee53eab7c4a16ef938f32517c1c5c59834f65e.zip
egit-github-f9ee53eab7c4a16ef938f32517c1c5c59834f65e.tar.gz
egit-github-f9ee53eab7c4a16ef938f32517c1c5c59834f65e.tar.bz2
Remove HttpClient dependency from org.eclipse.mylyn.github.uirefs/changes/50/3450/1
Change-Id: I3ceededde727c60e69a28d3326dcb5d93e5e2a89 Signed-off-by: Christian Trutz <christian.trutz@gmail.com>
-rw-r--r--org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client/GitHubClient.java24
-rw-r--r--org.eclipse.mylyn.github.ui/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/RepositorySelectionWizardPage.java5
3 files changed, 20 insertions, 12 deletions
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client/GitHubClient.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client/GitHubClient.java
index 610ca11..487a808 100644
--- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client/GitHubClient.java
+++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client/GitHubClient.java
@@ -11,11 +11,6 @@
*******************************************************************************/
package org.eclipse.egit.github.core.client;
-import com.google.gson.FieldNamingPolicy;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonParseException;
-
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -50,6 +45,11 @@ import org.apache.http.protocol.HttpContext;
import org.eclipse.egit.github.core.Assert;
import org.eclipse.egit.github.core.RequestError;
+import com.google.gson.FieldNamingPolicy;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonParseException;
+
/**
* Client class for interacting with GitHub HTTP/JSON API.
*/
@@ -73,8 +73,18 @@ public class GitHubClient {
* Create default client
*/
public GitHubClient() {
- this(new HttpHost(IGitHubConstants.HOST_API, -1,
- IGitHubConstants.PROTOCOL_HTTPS));
+ this(IGitHubConstants.HOST_API, -1, IGitHubConstants.PROTOCOL_HTTPS);
+ }
+
+ /**
+ * Create client for host configuration
+ *
+ * @param hostname
+ * @param port
+ * @param scheme
+ */
+ public GitHubClient(String hostname, int port, String scheme) {
+ this(new HttpHost(hostname, port, scheme));
}
/**
diff --git a/org.eclipse.mylyn.github.ui/META-INF/MANIFEST.MF b/org.eclipse.mylyn.github.ui/META-INF/MANIFEST.MF
index 276e3fb..5b41bca 100644
--- a/org.eclipse.mylyn.github.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.github.ui/META-INF/MANIFEST.MF
@@ -27,5 +27,4 @@ Export-Package: org.eclipse.mylyn.github.ui.internal;x-internal:=true,
org.eclipse.mylyn.internal.github.ui.gist;x-internal:=true,
org.eclipse.mylyn.internal.github.ui.issue;x-internal:=true
Bundle-ActivationPolicy: lazy
-Import-Package: org.apache.http;version="4.1.0",
- org.eclipse.egit.ui.internal;version="0.12.0"
+Import-Package: org.eclipse.egit.ui.internal;version="0.12.0"
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/RepositorySelectionWizardPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/RepositorySelectionWizardPage.java
index 94b80d7..10f805a 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/RepositorySelectionWizardPage.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/RepositorySelectionWizardPage.java
@@ -17,7 +17,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import org.apache.http.HttpHost;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.egit.github.core.Repository;
import org.eclipse.egit.github.core.client.GitHubClient;
@@ -208,9 +207,9 @@ public class RepositorySelectionWizardPage extends WizardPage {
public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
- HttpHost httpHost = new HttpHost(IGitHubConstants.HOST_API_V2, -1,
+ GitHubClient client = new GitHubClient(
+ IGitHubConstants.HOST_API_V2, -1,
IGitHubConstants.PROTOCOL_HTTPS);
- GitHubClient client = new GitHubClient(httpHost);
client.setCredentials(user, password);
RepositoryService service = new RepositoryService(client);
repoCount = 0;