refactor out resteasy from adapters
This commit is contained in:
1 parent
ac64eba667
commit
6380dc3d1b
57 files changed
+2444
-670
No files matched your search
@@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.net.URI;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.List;
|
||||
|
||||
@@ -34,7 +35,13 @@ public class DummySocialServlet extends HttpServlet {
|
||||
String state = null;
|
||||
String redirectUri = null;
|
||||
|
||||
List<NameValuePair> query = URLEncodedUtils.parse(req.getQueryString(), Charset.forName("UTF-8"));
|
||||
List<NameValuePair> query = null;
|
||||
try {
|
||||
URI uri = URI.create(req.getRequestURL().append('?').append(req.getQueryString()).toString());
|
||||
query = URLEncodedUtils.parse(uri, "UTF-8");
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
for (NameValuePair p : query) {
|
||||
if ("state".equals(p.getName())) {
|
||||
state = p.getValue();
|
||||
|
||||
@@ -43,6 +43,7 @@ import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
|
||||
import javax.ws.rs.core.UriBuilder;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.charset.Charset;
|
||||
@@ -127,7 +128,12 @@ public class OAuthClient {
|
||||
parameters.add(new BasicNameValuePair("password", password));
|
||||
}
|
||||
|
||||
UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(parameters, Charset.forName("UTF-8"));
|
||||
UrlEncodedFormEntity formEntity = null;
|
||||
try {
|
||||
formEntity = new UrlEncodedFormEntity(parameters, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
post.setEntity(formEntity);
|
||||
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user