[CT414]: Assignment 1 working
This commit is contained in:
@ -1,10 +1,12 @@
|
||||
package implementations;
|
||||
|
||||
import interfaces.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import java.rmi.*;
|
||||
|
||||
public class ApplicationFormV1 implements ApplicationForm {
|
||||
public class ApplicationFormV1 implements ApplicationForm, Serializable {
|
||||
private String formInfo = "University of Galway Application Form - Version 1";
|
||||
private String[] questions = new String[5];
|
||||
private String[] answers = new String[5];
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user