Proba naprawienia]
Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
parent
df90a57715
commit
3335155cd8
@ -48,23 +48,22 @@ public class UsosApiService {
|
|||||||
* @return UserApiResponse modle contatining desired values
|
* @return UserApiResponse modle contatining desired values
|
||||||
*/
|
*/
|
||||||
public UserApiResponse getUserData(String usosId) {
|
public UserApiResponse getUserData(String usosId) {
|
||||||
final UserApiResponse apiResponse = new UserApiResponse();
|
final UserApiResponse apiResponse = new UserApiResponse();
|
||||||
try {
|
try {
|
||||||
final OAuth10aService service = new ServiceBuilder(apikey).apiSecret(apisecret)
|
final OAuth10aService service = new ServiceBuilder(apikey).apiSecret(apisecret)
|
||||||
.build(UsosOauth1Service.instance());
|
.build(UsosOauth1Service.instance());
|
||||||
|
|
||||||
final OAuthRequest request = new OAuthRequest(Verb.GET, apiUrl + "/services/users/user?user_id=" + usosId);
|
final OAuthRequest request = new OAuthRequest(Verb.GET, apiUrl + "/services/users/user?user_id=" + usosId);
|
||||||
service.signRequest(new OAuth1AccessToken("", ""), request);
|
service.signRequest(new OAuth1AccessToken("", ""), request);
|
||||||
System.out.println("PRZED TRY");
|
System.out.println("PRZED TRY");
|
||||||
try (Response response = service.execute(request)) {
|
try (Response response = service.execute(request)) {
|
||||||
System.out.println("TRY");
|
System.out.println("TRY");
|
||||||
final String json = response.getBody();
|
final String json = response.getBody();
|
||||||
System.out.println(json == null);
|
System.out.println(json == null);
|
||||||
System.out.println(json == "null");
|
System.out.println(json == "null");
|
||||||
System.out.println(json.equals("null"));
|
System.out.println(json.equals("null"));
|
||||||
//System.out.println(json.equals(null));
|
|
||||||
System.out.println(json);
|
System.out.println(json);
|
||||||
if (json != "null" && json != null){
|
if (!json.equals("null")){
|
||||||
System.out.println(json);
|
System.out.println(json);
|
||||||
System.out.println(json.getClass());
|
System.out.println(json.getClass());
|
||||||
System.out.println("Przed Object");
|
System.out.println("Przed Object");
|
||||||
@ -78,13 +77,13 @@ public class UsosApiService {
|
|||||||
System.out.println(map.get(NAME_FIELD));
|
System.out.println(map.get(NAME_FIELD));
|
||||||
apiResponse.setSurname(map.get(SURNAME_FIELD));
|
apiResponse.setSurname(map.get(SURNAME_FIELD));
|
||||||
System.out.println(map.get(SURNAME_FIELD));
|
System.out.println(map.get(SURNAME_FIELD));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException | InterruptedException | ExecutionException e) {
|
} catch (IOException | InterruptedException | ExecutionException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
return apiResponse;
|
return apiResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user