package com.blancoz.jiffy.server.config;

import java.util.HashMap;

public class JiffyConfig {

  private HashMap<String, String> properties = new HashMap<String, String>();

  public int getPort() {
    return Integer.parseInt(properties.get("port"));
  }

  public void setPort(int port) {
    if(port > 0) {
      properties.put("port", port + "");
    }
  }

  public void setProperty(String key, String value) {
    properties.put(key, value);
  }

}

@@ -52,23 +52,26 @@
 va.util.
-HashMap
+Properties
 ;%0A%0Apubli
@@ -99,160 +99,336 @@
 %0A%0A  
-private HashMap%3CString, String%3E properties = new HashMap%3CString, String%3E();%0A%0A  public int
+static final String PROPERTY_PORT = %22jiffy.port%22;%0A  static final int MAX_PORT = 65535;%0A  static final int MIN_PORT = 1025;%0A%0A  private Properties propList = new Properties();%0A%0A  static final int JIFFY_DEFAULT_PORT = 7090;%0A%0A  private String
  getP
-ort() %7B%0A    return Integer.parseInt(properties.get(%22port%22)
+roperty(String prop) throws NullPointerException %7B%0A    return System.getProperty(prop
 );%0A 
@@ -426,37 +426,38 @@
 (prop);%0A  %7D%0A%0A  p
-ublic
+rivate
  void setPort(in
@@ -454,184 +454,729 @@
 setP
-ort(int port) %7B%0A    if(port %3E 0) %7B%0A      properties.put(%22port%22, port + %22%22);%0A    %7D%0A  %7D%0A%0A  public void setProperty(String key, String value) %7B%0A    properties.put(key, value);%0A  %7D
+roperty(String property, String value) throws NullPointerException %7B%0A    if(property != null && value != null) %7B%0A      propList.setProperty(property, value);%0A    %7D else if(property == null) %7B%0A      throw new NullPointerException(%22Property cannot be null%22);%0A    %7D else %7B%0A      throw new NullPointerException(%22Property value cannot be null%22);%0A    %7D%0A  %7D%0A%0A  public int getPort() %7B%0A    String port = getProperty(PROPERTY_PORT);%0A    return Integer.parseInt(port);%0A  %7D%0A%0A  public void setPort(int port) %7B%0A    if(port %3C= MAX_PORT && port %3E= MIN_PORT) %7B%0A      propList.setProperty(PROPERTY_PORT, port + %22%22);%0A    %7D else %7B%0A      throw new IllegalArgumentException(%22Port must be between: %22 + MIN_PORT + %22 and %22 + MAX_PORT);%0A    %7D%0A  %7D%0A
 %0A%0A%7D%0A

Update for Jiffy Config to address #2. Still need to add a readFile method for configuration files.