Еще уменьшение количества строк

This commit is contained in:
sasha0552 2019-04-10 04:03:25 +06:00
parent 8b6359255a
commit e046b0298c

View file

@ -47,30 +47,15 @@ protected boolean updateServerID(UUID uuid, String serverID) throws IOException
}
protected String updAccessToken(final String accessToken, final String username) throws IOException {
final String type = "SetAccessToken";
final String encodedUsername = IOHelper.urlEncode(Objects.toString(username));
final String encodedAccessToken = IOHelper.urlEncode(Objects.toString(accessToken));
final URL formattedUrl = new URL(
CommonHelper.replace(url, "type", type, "username", encodedUsername, "uuid", encodedAccessToken));
return IOHelper.request(formattedUrl);
return IOHelper.request(new URL(CommonHelper.replace(url, "type", "SetAccessToken", "username", IOHelper.urlEncode(Objects.toString(username)), "uuid", IOHelper.urlEncode(Objects.toString(accessToken)))));
}
protected String updServerID(final UUID uuid, final String serverID) throws IOException {
final String type = "SetServerID";
final String encodedUUID = IOHelper.urlEncode(Objects.toString(uuid));
final String encodedID = IOHelper.urlEncode(serverID);
final URL formattedUrl = new URL(
CommonHelper.replace(url, "type", type, "uuid", encodedUUID, "ServerID", encodedID));
return IOHelper.request(formattedUrl);
return IOHelper.request(new URL(CommonHelper.replace(url, "type", "SetServerID", "uuid", IOHelper.urlEncode(Objects.toString(uuid)), "ServerID", IOHelper.urlEncode(serverID))));
}
protected String updUUID(final UUID uuid, final String username) throws IOException {
final String type = "SetUUID";
final String encodedUsername = IOHelper.urlEncode(Objects.toString(username));
final String encodedUUID = IOHelper.urlEncode(Objects.toString(uuid));
final URL formattedUrl = new URL(
CommonHelper.replace(url, "type", type, "username", encodedUsername, "uuid", encodedUUID));
return IOHelper.request(formattedUrl);
return IOHelper.request(new URL(CommonHelper.replace(url, "type", "SetUUID", "username", IOHelper.urlEncode(Objects.toString(username)), "uuid", IOHelper.urlEncode(Objects.toString(uuid)))));
}
@Override