Compare commits

..

No commits in common. "main" and "gui" have entirely different histories.
main ... gui

9 changed files with 289 additions and 492 deletions

View File

@ -1,3 +0,0 @@
Selim Eser 2211482: Selim Eser, Selim
David Groys 3012642: David Groys
Daniel Zdravkovic 3012893: Daniel Zdravkovic

View File

@ -225,9 +225,6 @@ public class System {
if (!new_password.equals(new_password_authentication))
return false;
if(old_password.equals(new_password))
return false;
for (int i = 0; i < this.all_user.size(); i++)
if (this.all_user.get(i).getUsername().equals(current_user.getUsername()))
this.all_user.remove(i);
@ -279,8 +276,7 @@ public class System {
String line;
while ((line = reader.readLine()) != null && zip_set.size() < 200) {
line = line.replace("\"", "");
if (line.split(";")[0].toUpperCase().startsWith(hometown_or_zip.toUpperCase())
|| line.split(";")[1].toUpperCase().startsWith(hometown_or_zip.toUpperCase()))
if (line.split(";")[0].contains(hometown_or_zip) || line.split(";")[1].contains(hometown_or_zip))
zip_set.add(line);
}
} catch (Exception e) {
@ -347,24 +343,13 @@ public class System {
try {
HttpClient http_client = HttpClient.newHttpClient();
HttpRequest get_request;
if(current_user.getZip().length()<5){
get_request = HttpRequest.newBuilder()
.uri(new URI("https://api.openweathermap.org/data/2.5/weather?q=" + current_user.getHometown()
+ ",de&appid=" + api_key + "&units=metric&lang=de"))
.GET()
.build();
}
else{
get_request = HttpRequest.newBuilder()
HttpRequest get_request = HttpRequest.newBuilder()
.uri(new URI("https://api.openweathermap.org/data/2.5/weather?zip=" + current_user.getZip()
+ ",de&appid=" + api_key + "&units=metric&lang=de"))
.GET()
.build();
}
HttpResponse<String> get_response = http_client.send(get_request, BodyHandlers.ofString());
JSONObject json = new JSONObject(get_response.body());
@ -424,23 +409,13 @@ public class System {
try {
HttpClient http_client = HttpClient.newHttpClient();
HttpRequest get_request;
if(destination_zip.length()<5){
get_request = HttpRequest.newBuilder()
.uri(new URI("https://api.openweathermap.org/data/2.5/forecast?q=" + search(destination_zip).get(0).split(";")[1]
+ ",de&appid=" + api_key + "&units=metric&lang=de"))
.GET()
.build();
}
else{
get_request = HttpRequest.newBuilder()
HttpRequest get_request = HttpRequest.newBuilder()
.uri(new URI("https://api.openweathermap.org/data/2.5/forecast?zip=" + destination_zip
+ ",de&appid=" + api_key + "&units=metric&lang=de"))
.GET()
.build();
}
HttpResponse<String> get_response = http_client.send(get_request, BodyHandlers.ofString());
JSONObject json = new JSONObject(get_response.body());

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB