diff --git a/src/main/java/de/hs_mannheim/domain/System.java b/src/main/java/de/hs_mannheim/domain/System.java index fc3c47c..3b18178 100644 --- a/src/main/java/de/hs_mannheim/domain/System.java +++ b/src/main/java/de/hs_mannheim/domain/System.java @@ -79,9 +79,25 @@ public class System { } } catch (Exception e) { } + + all_users.add(current_user); + return all_users; } + public ArrayList all_user_toString(){ + + ArrayList result = new ArrayList<>(); + ArrayList all_user = get_all_user(); + + for(User user : all_user){ + result.add(getDetails()[0] + ";" + getDetails()[1] + ";" + getDetails()[2] + ";" + getDetails()[3] + + ";" + getDetails()[4] + ";" + getDetails()[5] + ";" + getDetails()[6] + ";" + getDetails()[7]); + } + + return result; + } + public boolean sign_in_user(String username, String password) { ArrayList mem = get_all_user(); @@ -129,6 +145,16 @@ public class System { return true; } + public void write_to_file(ArrayList lines, String file) { + try (BufferedWriter writer = new BufferedWriter(new FileWriter(file))) { + for (int i = 0; i < lines.size() - 1; i++) { + writer.write(lines.get(i)); + writer.newLine(); + } + writer.write(lines.getLast()); + } catch (IOException e) {} + } + /*public boolean sign_up_user(String username, String password, String hometown, String zipS, String car_name, String car_l_100kmS, String car_avg_kmhS, String bike_avg_kmhS) throws IOException { int zip = Integer.parseInt(zipS);