Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IPZillaQuery.java')
-rw-r--r--org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IPZillaQuery.java21
1 files changed, 11 insertions, 10 deletions
diff --git a/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IPZillaQuery.java b/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IPZillaQuery.java
index 7d9f9a64c8..b8db84a89c 100644
--- a/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IPZillaQuery.java
+++ b/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IPZillaQuery.java
@@ -59,6 +59,7 @@ import java.net.ProxySelector;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLEncoder;
+import java.text.MessageFormat;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
@@ -135,8 +136,8 @@ class IPZillaQuery {
HttpURLConnection conn = open(csv);
if (HttpSupport.response(conn) != HttpURLConnection.HTTP_OK) {
- throw new IOException("Query " + csv + " failed: "
- + conn.getResponseCode() + " " + conn.getResponseMessage());
+ throw new IOException(MessageFormat.format(IpLogText.get().queryFailed
+ , csv, conn.getResponseCode() + " " + conn.getResponseMessage()));
}
BufferedReader br = reader(conn);
@@ -185,23 +186,23 @@ class IPZillaQuery {
out.close();
if (HttpSupport.response(c) != HttpURLConnection.HTTP_OK) {
- throw new IOException("Login as " + username + " to " + login
- + " failed: " + c.getResponseCode() + " "
- + c.getResponseMessage());
+ throw new IOException(MessageFormat.format(IpLogText.get().loginFailed
+ , username, login, c.getResponseCode() + " " + c.getResponseMessage()));
}
String content = readFully(c);
Matcher matcher = Pattern.compile("<title>(.*)</title>",
Pattern.CASE_INSENSITIVE).matcher(content);
if (!matcher.find()) {
- throw new IOException("Login as " + username + " to " + login
- + " failed: Response not HTML as expected");
+ throw new IOException(MessageFormat.format(IpLogText.get().loginFailed
+ , username, login, IpLogText.get().responseNotHTMLAsExpected));
}
String title = matcher.group(1);
if (!"IPZilla Main Page".equals(title)) {
- throw new IOException("Login as " + username + " to " + login
- + " failed; page title was \"" + title + "\"");
+ throw new IOException(MessageFormat.format(IpLogText.get().loginFailed
+ , username, login
+ , MessageFormat.format(IpLogText.get().pageTitleWas, title)));
}
}
@@ -246,7 +247,7 @@ class IPZillaQuery {
try {
CookieHandler.getDefault().put(url.toURI(), cols);
} catch (URISyntaxException e) {
- IOException err = new IOException("Invalid URI format:" + url);
+ IOException err = new IOException(MessageFormat.format(IpLogText.get().invalidURIFormat, url));
err.initCause(e);
throw err;
}

Back to the top