diff options
author | Christian Trutz | 2011-05-18 04:50:21 +0000 |
---|---|---|
committer | Christian Trutz | 2011-05-18 04:50:21 +0000 |
commit | f9ee53eab7c4a16ef938f32517c1c5c59834f65e (patch) | |
tree | d2f7d348b2db944a0b03b3027a5249e277408f26 | |
parent | a4d4465d80c4b9141da2d0ea89c338a288664d28 (diff) | |
download | egit-github-f9ee53eab7c4a16ef938f32517c1c5c59834f65e.tar.gz egit-github-f9ee53eab7c4a16ef938f32517c1c5c59834f65e.tar.xz egit-github-f9ee53eab7c4a16ef938f32517c1c5c59834f65e.zip |
Remove HttpClient dependency from org.eclipse.mylyn.github.ui
Change-Id: I3ceededde727c60e69a28d3326dcb5d93e5e2a89
Signed-off-by: Christian Trutz <christian.trutz@gmail.com>
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 610ca112..487a8082 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 276e3fb5..5b41bcaf 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 94b80d73..10f805a2 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; |