[CT414]: Assignment 1 working

This commit is contained in:
2025-01-24 16:43:34 +00:00
parent 2d340bda25
commit 41933cb734
5 changed files with 21 additions and 15 deletions

View File

@ -38,7 +38,7 @@ public class ApplicationHandlerImpl implements ApplicationHandler {
@Override
public void submitApplicationForm(long sessionID, ApplicationForm applicationForm) throws RemoteException, InvalidSessionIDException {
if (sessions.contains(sessionID)) {
String filename = applicationForm.getName().replace("\\s", "_") + ".txt";
String filename = applicationForm.getName().replaceAll("\\s", "_") + ".txt";
try (BufferedWriter writer = new BufferedWriter(new FileWriter(filename))) {
System.out.println("Saving application form to file: " + filename);