This commit is contained in:
Rafał Borcz
2018-03-04 12:49:16 +01:00
committed by Mikołaj Pich
parent a1a3427142
commit 79bdbbbb16
158 changed files with 4369 additions and 3753 deletions

View File

@ -48,7 +48,7 @@ public class Vulcan {
this.login = login;
}
public String login(String email, String password, String symbol)
public void login(String email, String password, String symbol)
throws BadCredentialsException, AccountPermissionException,
LoginErrorException, IOException, VulcanOfflineException {
@ -56,8 +56,6 @@ public class Vulcan {
login = getLogin();
this.symbol = login.login(this.email, password, symbol);
return this.symbol;
}
public Vulcan login(String email, String password, String symbol, String id)
@ -82,6 +80,10 @@ public class Vulcan {
return email;
}
public String getSymbol() {
return symbol;
}
private void setFullEndpointInfo(String email) {
String[] creds = email.split("\\\\");

View File

@ -27,14 +27,6 @@ public class Login {
this.client = client;
}
private String getLoginPageUrl() {
return LOGIN_PAGE_URL;
}
private String getLoginEndpointPageUrl() {
return LOGIN_ENDPOINT_PAGE_URL;
}
public String login(String email, String password, String symbol)
throws BadCredentialsException, LoginErrorException,
AccountPermissionException, IOException, VulcanOfflineException {
@ -47,7 +39,7 @@ public class Login {
throws IOException, BadCredentialsException {
this.symbol = symbol;
Document html = client.postPageByUrl(getLoginPageUrl(), new String[][]{
Document html = client.postPageByUrl(LOGIN_PAGE_URL, new String[][]{
{"LoginName", email},
{"Password", password}
});
@ -64,8 +56,7 @@ public class Login {
this.symbol = findSymbol(defaultSymbol, certificate);
client.setSymbol(this.symbol);
Document html = client.postPageByUrl(getLoginEndpointPageUrl()
.replace("{symbol}", this.symbol), new String[][]{
Document html = client.postPageByUrl(LOGIN_ENDPOINT_PAGE_URL, new String[][]{
{"wa", "wsignin1.0"},
{"wresult", certificate}
});
@ -103,4 +94,4 @@ public class Login {
return els.get(1).text();
}
}
}