Skip to content

Commit f19fb12

Browse files
committed
Packaged all the files
1 parent 776765e commit f19fb12

21 files changed

+70
-19
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
22
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
33

4-
# User-specific stuff
4+
# Entities.User-specific stuff
55
.idea/**/workspace.xml
66
.idea/**/tasks.xml
77
.idea/**/usage.statistics.xml
88
.idea/**/dictionaries
99
.idea/**/shelf
1010

11-
# AWS User-specific
11+
# AWS Entities.User-specific
1212
.idea/**/aws.xml
1313

1414
# Generated files

src/main/java/IRetrieveList.java renamed to src/main/java/Controllers/IRetrieveList.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package Controllers;
2+
import Entities.User;
13
import java.util.List;
24

35
public interface IRetrieveList {
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package Controllers;
2+
13
public interface UserExists {
24
boolean UserExists(String username, String password);
35
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package Controllers;
2+
13
public interface UserRegistrationUseCase {
24
void registerUser(String username, String password, String email);
35
}

src/main/java/BasicUser.java renamed to src/main/java/Entities/BasicUser.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
public class BasicUser extends User{
1+
package Entities;
2+
3+
import Entities.User;
4+
5+
public class BasicUser extends User {
26
public BasicUser(String Username, String Password, String Email){
37
super(Username, Password, Email);
48
}

src/main/java/User.java renamed to src/main/java/Entities/User.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
package Entities;
2+
import UseCase.Changeable;
13
import java.io.Serializable;
2-
public abstract class User implements Serializable, Changeable{
4+
public abstract class User implements Serializable, Changeable {
35
protected String username;
46
protected String password;
57
protected String email;
@@ -21,7 +23,7 @@ private String getPassword(){
2123
}
2224

2325
@Override
24-
// from Changeable
26+
// from UseCase.Changeable
2527
public void changeFeature(String feature, String newFeature){
2628
if (feature == "Username"){
2729
this.username = newFeature;

src/main/java/UserFactory.java renamed to src/main/java/Entities/UserFactory.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
package Entities;
2+
3+
import Entities.BasicUser;
4+
import Entities.User;
5+
16
public class UserFactory {
27
//Following the factory design pattern, just in case in the future we decide to add various different types of Users
38
public static User BirthUser(String Username, String Password, String Email, String type){

src/main/java/UserDatabase.java renamed to src/main/java/UI/UserDatabase.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1+
package UI;
2+
3+
import Controllers.IRetrieveList;
4+
import Controllers.UserExists;
5+
import Entities.User;
6+
import Entities.UserFactory;
7+
import UseCase.UserCreator;
8+
import UseCase.UserRetriever;
9+
110
import java.io.*;
211
import java.util.ArrayList;
312
import java.util.List;
4-
public class UserDatabase implements UserExists, UserRetriever, UserCreator, IRetrieveList{
13+
public class UserDatabase implements UserExists, UserRetriever, UserCreator, IRetrieveList {
514
File accounts;
615
List<User> accountList;
716
public UserDatabase(){
@@ -72,7 +81,7 @@ public List<User> getList() {
7281
/*
7382
while(true){
7483
try{
75-
User user = (User) in.readObject();
84+
Entities.User user = (Entities.User) in.readObject();
7685
users.add(user);}
7786
catch(EOFException e){
7887
break;

src/main/java/UserRegistrationUI.java renamed to src/main/java/UI/UserRegistrationUI.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import junit.framework.JUnit4TestAdapter;
1+
package UI;
22

3+
import Controllers.UserRegistrationUseCase;
34
import javax.swing.*;
45
import java.awt.event.ActionEvent;
56
import java.awt.event.ActionListener;
6-
import java.util.Random;
77
import java.io.File;
88

99
public class UserRegistrationUI implements UserRegistrationUseCase, ActionListener {
@@ -18,7 +18,7 @@ public class UserRegistrationUI implements UserRegistrationUseCase, ActionListen
1818

1919
public UserRegistrationUI(UserDatabase database) {
2020
this.database = database;
21-
/*TODO: For now the code is 389 for testing purposes, but once UserVerificationUI.sendVerificationCode() is
21+
/*TODO: For now the code is 389 for testing purposes, but once UI.UserVerificationUI.sendVerificationCode() is
2222
implemented this will be a random integer.
2323
*/
2424
/*code = new Random().nextInt(1244254);*/
@@ -86,7 +86,7 @@ public void registerUser(String username, String password, String email) {
8686
}
8787
//For Testing purposes
8888
public static void main(String[] args){
89-
UserDatabase testDB = new UserDatabase(new File("Test4"));
89+
UserDatabase testDB = new UserDatabase(new File("Test5"));
9090
System.out.println(testDB.UserExists("RandomUser", "[email protected]"));
9191
System.out.println(testDB.getList().size());
9292
UserRegistrationUI testUI = new UserRegistrationUI(testDB);

src/main/java/UserVerificationUI.java renamed to src/main/java/UI/UserVerificationUI.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
package UI;
2+
3+
import UseCase.UserVerifier;
4+
import UseCase.verificationMethodFactory;
5+
16
import javax.swing.*;
27
import java.awt.event.ActionEvent;
38
import java.awt.event.ActionListener;
@@ -47,7 +52,7 @@ public void verify(String email){
4752

4853
//For testing purposes
4954
/*public static void main(String[] args){
50-
UserVerificationUI ver = new UserVerificationUI(389);
55+
UI.UserVerificationUI ver = new UI.UserVerificationUI(389);
5156
ver.verify("abc");
5257
}*/
5358

0 commit comments

Comments
 (0)