Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2008-04-18 01:14:28 +0000
committerrelves2008-04-18 01:14:28 +0000
commit99bb7956d565f7543aa8d01137045c9700c4093a (patch)
treed80f9887fdc5994a1a239b676c7765c85e12462f /org.eclipse.mylyn.bugzilla.core
parent265e439bd21d70cef82434faf56f590a4882d91e (diff)
downloadorg.eclipse.mylyn.tasks-99bb7956d565f7543aa8d01137045c9700c4093a.tar.gz
org.eclipse.mylyn.tasks-99bb7956d565f7543aa8d01137045c9700c4093a.tar.xz
org.eclipse.mylyn.tasks-99bb7956d565f7543aa8d01137045c9700c4093a.zip
REOPENED - bug 225872: implement cancellation support for Bugzilla
https://bugs.eclipse.org/bugs/show_bug.cgi?id=225872
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core')
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java14
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/GzipGetMethod.java14
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/GzipPostMethod.java17
3 files changed, 13 insertions, 32 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
index 4257feb2c..1a61e7ee5 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
@@ -403,7 +403,7 @@ public class BugzillaClient {
if (hasAuthenticationCredentials()) {
BufferedReader responseReader = new BufferedReader(new InputStreamReader(
- postMethod.getResponseBodyAsUnzippedStream(), characterEncoding));
+ postMethod.getResponseBodyAsStream(), characterEncoding));
HtmlStreamTokenizer tokenizer = new HtmlStreamTokenizer(responseReader, null);
for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) {
@@ -499,7 +499,7 @@ public class BugzillaClient {
for (String type : VALID_CONFIG_CONTENT_TYPES) {
if (responseTypeHeader.getValue().toLowerCase(Locale.ENGLISH).contains(type)) {
RepositoryQueryResultsFactory queryFactory = new RepositoryQueryResultsFactory(
- postMethod.getResponseBodyAsUnzippedStream(), characterEncoding);
+ postMethod.getResponseBodyAsStream(), characterEncoding);
int count = queryFactory.performQuery(repositoryUrl.toString(), collector,
AbstractTaskDataCollector.MAX_HITS);
return count > 0;
@@ -507,7 +507,7 @@ public class BugzillaClient {
}
}
- parseHtmlError(new BufferedReader(new InputStreamReader(postMethod.getResponseBodyAsUnzippedStream(),
+ parseHtmlError(new BufferedReader(new InputStreamReader(postMethod.getResponseBodyAsStream(),
characterEncoding)));
} finally {
if (postMethod != null) {
@@ -707,7 +707,7 @@ public class BugzillaClient {
// httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(CONNECT_TIMEOUT);
int status = WebUtil.execute(httpClient, hostConfiguration, postMethod, monitor);
if (status == HttpStatus.SC_OK) {
- InputStreamReader reader = new InputStreamReader(postMethod.getResponseBodyAsUnzippedStream(),
+ InputStreamReader reader = new InputStreamReader(postMethod.getResponseBodyAsStream(),
postMethod.getResponseCharSet());
BufferedReader bufferedReader = new BufferedReader(reader);
@@ -799,7 +799,7 @@ public class BugzillaClient {
if (method == null) {
throw new IOException("Could not post form, client returned null method.");
}
- BufferedReader in = new BufferedReader(new InputStreamReader(method.getResponseBodyAsUnzippedStream(),
+ BufferedReader in = new BufferedReader(new InputStreamReader(method.getResponseBodyAsStream(),
method.getRequestCharSet()));
in.mark(1028);
HtmlStreamTokenizer tokenizer = new HtmlStreamTokenizer(in, null);
@@ -1221,7 +1221,7 @@ public class BugzillaClient {
for (String type : VALID_CONFIG_CONTENT_TYPES) {
if (responseTypeHeader.getValue().toLowerCase(Locale.ENGLISH).contains(type)) {
MultiBugReportFactory factory = new MultiBugReportFactory(
- method.getResponseBodyAsUnzippedStream(), characterEncoding);
+ method.getResponseBodyAsStream(), characterEncoding);
AbstractTaskDataCollector collector2 = new AbstractTaskDataCollector() {
@@ -1241,7 +1241,7 @@ public class BugzillaClient {
}
if (!parseable) {
- parseHtmlError(new BufferedReader(new InputStreamReader(method.getResponseBodyAsUnzippedStream(),
+ parseHtmlError(new BufferedReader(new InputStreamReader(method.getResponseBodyAsStream(),
characterEncoding)));
break;
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/GzipGetMethod.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/GzipGetMethod.java
index 29e3f65cf..e7befe942 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/GzipGetMethod.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/GzipGetMethod.java
@@ -88,21 +88,11 @@ public class GzipGetMethod extends GetMethod {
super.getResponseBody();
}
- /**
- * getResponseBodyAsUnzippedStream checks a usable (decoded if necessary) stream. It checks the headers the headers
- * and decides accordingly.
- *
- * @return a decoded stream to be used as plain stream.
- * @throws IOException
- */
- public InputStream getResponseBodyAsUnzippedStream() throws IOException {
+ @Override
+ public InputStream getResponseBodyAsStream() throws IOException {
InputStream input = super.getResponseBodyAsStream();
if (gzipReceived) {
- try {
return new java.util.zip.GZIPInputStream(input);
- } catch (IOException e) {
- // FIXME log this
- }
}
return input;
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/GzipPostMethod.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/GzipPostMethod.java
index 9d6507aed..e10dd1499 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/GzipPostMethod.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/GzipPostMethod.java
@@ -88,22 +88,13 @@ public class GzipPostMethod extends PostMethod {
super.getResponseBody();
}
- /**
- * getResponseBodyAsUnzippedStream checks a usable (decoded if necessary) stream. It checks the headers and decides
- * accordingly.
- *
- * @return a decoded stream to be used as plain stream.
- * @throws IOException
- */
- public InputStream getResponseBodyAsUnzippedStream() throws IOException {
+ @Override
+ public InputStream getResponseBodyAsStream() throws IOException {
InputStream input = super.getResponseBodyAsStream();
if (gzipReceived) {
- try {
- return new java.util.zip.GZIPInputStream(input);
- } catch (IOException e) {
- // TODO log this
- }
+ return new java.util.zip.GZIPInputStream(input);
}
return input;
}
+
}

Back to the top