Added QueryStringEncoder.toString()

This commit is contained in:
Trustin Lee 2008-12-01 05:29:59 +00:00
parent 2d92771ae6
commit 7d37a2f78b

View File

@ -50,8 +50,13 @@ public class QueryStringEncoder {
}
public URI toUri() throws URISyntaxException {
return new URI(toString());
}
@Override
public String toString() {
if (params.size() == 0) {
return new URI(url);
return url;
}
else {
StringBuilder sb = new StringBuilder(url).append("?");
@ -62,7 +67,7 @@ public class QueryStringEncoder {
sb.append("&");
}
}
return new URI(sb.toString());
return sb.toString();
}
}