Skip to content

Commit

Permalink
modify var names; add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
HliasMpGH committed Feb 28, 2024
1 parent 7289721 commit 796c6ba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 22 deletions.
12 changes: 6 additions & 6 deletions gui/src/main/java/gr/bibliotech/PropertyHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
public class PropertyHandler {

// the file of apps' configurations
private static String propFileName = "config.xml";
private static String configFileName = "config.xml";

// the apps' properties
private static Properties prop = new Properties();
// the apps' configurations
private static Properties configs = new Properties();

// the ClassLoader of this class, used for accessing properties
private static ClassLoader loader = PropertyHandler.class.getClassLoader();
Expand All @@ -19,9 +19,9 @@ public class PropertyHandler {
// init config memory upon application boot up
static {
if (loader != null) {
try (InputStream config = loader.getResourceAsStream(propFileName)) {
try (InputStream config = loader.getResourceAsStream(configFileName)) {
// load config file as a property
prop.loadFromXML(config);
configs.loadFromXML(config);
} catch (IOException e) {
System.out.println(e.getMessage());
}
Expand All @@ -34,7 +34,7 @@ public class PropertyHandler {
* @return the config file of the app as a property
*/
public static Properties getConfig() {
return prop;
return configs;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ public String showRegisterPage() {
}

/**
* Configures GET requests upon user search
* interaction. Presents results of the
* requests.
* Validates the info of a user
* when a login takes place
*/
@PostMapping("login/validate")
public String showResults(@RequestParam("username") String username,
Expand All @@ -62,9 +61,8 @@ public String showResults(@RequestParam("username") String username,
}

/**
* Configures GET requests upon user search
* interaction. Presents results of the
* requests.
* Validates the info of a user
* when a new registration takes place
*/
@PostMapping("register/validate")
public String showResults(@RequestParam("username") String username,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,4 @@ public String showResults(@RequestParam("query") String query,

return "bookSearch.html";
}

/**
* Configures GET requests upon user search
* interaction. Presents results of the
* requests.
*/
@GetMapping("/register")
public String showResults() {
return "register.html";
}
}

0 comments on commit 796c6ba

Please sign in to comment.