|
@@ -12,22 +12,22 @@ public class ConnectionParams {
|
|
|
private String host;
|
|
|
private String user;
|
|
|
private String password;
|
|
|
- private boolean initilizeErr;
|
|
|
- private List<String> initilizeErrCause;
|
|
|
+ private boolean initializeErr;
|
|
|
+ private List<String> initializeErrCause;
|
|
|
|
|
|
public ConnectionParams(String host, String user, String password){
|
|
|
try {
|
|
|
this.host = Objects.requireNonNull(host);
|
|
|
this.user = Objects.requireNonNull(user);
|
|
|
this.password = Objects.requireNonNull(password);
|
|
|
- initilizeErr = false;
|
|
|
+ initializeErr = false;
|
|
|
} catch (NullPointerException ex){
|
|
|
ex.printStackTrace();
|
|
|
- initilizeErr = true;
|
|
|
- initilizeErrCause = new ArrayList<String>();
|
|
|
- if (Objects.isNull(host)) initilizeErrCause.add("host");
|
|
|
- if (Objects.isNull(user)) initilizeErrCause.add("user");
|
|
|
- if (Objects.isNull(password)) initilizeErrCause.add("password");
|
|
|
+ initializeErr = true;
|
|
|
+ initializeErrCause = new ArrayList<String>();
|
|
|
+ if (Objects.isNull(host)) initializeErrCause.add("host");
|
|
|
+ if (Objects.isNull(user)) initializeErrCause.add("user");
|
|
|
+ if (Objects.isNull(password)) initializeErrCause.add("password");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -39,14 +39,14 @@ public class ConnectionParams {
|
|
|
fis = new FileInputStream(filePath);
|
|
|
property.load(fis);
|
|
|
|
|
|
- initilizeErrCause = new ArrayList<String>();
|
|
|
- if (Objects.isNull(property.getProperty("CONFIG_DEFAULT_HOST"))) initilizeErrCause.add("host");
|
|
|
- if (Objects.isNull(property.getProperty("CONFIG_DEFAULT_USER"))) initilizeErrCause.add("user");
|
|
|
- if (Objects.isNull(property.getProperty("CONFIG_DEFAULT_PASS"))) initilizeErrCause.add("password");
|
|
|
+ initializeErrCause = new ArrayList<String>();
|
|
|
+ if (Objects.isNull(property.getProperty("CONFIG_DEFAULT_HOST"))) initializeErrCause.add("host");
|
|
|
+ if (Objects.isNull(property.getProperty("CONFIG_DEFAULT_USER"))) initializeErrCause.add("user");
|
|
|
+ if (Objects.isNull(property.getProperty("CONFIG_DEFAULT_PASS"))) initializeErrCause.add("password");
|
|
|
|
|
|
- initilizeErr = !initilizeErrCause.isEmpty();
|
|
|
+ initializeErr = !initializeErrCause.isEmpty();
|
|
|
|
|
|
- if (!initilizeErr) {
|
|
|
+ if (!initializeErr) {
|
|
|
this.host = property.getProperty("CONFIG_DEFAULT_HOST");
|
|
|
this.user = property.getProperty("CONFIG_DEFAULT_USER");
|
|
|
this.password = property.getProperty("CONFIG_DEFAULT_PASS");
|
|
@@ -54,19 +54,19 @@ public class ConnectionParams {
|
|
|
|
|
|
} catch (IOException ex) {
|
|
|
ex.printStackTrace();
|
|
|
- initilizeErr = true;
|
|
|
- initilizeErrCause = new ArrayList<String>();
|
|
|
- initilizeErrCause.add("filePath");
|
|
|
+ initializeErr = true;
|
|
|
+ initializeErrCause = new ArrayList<String>();
|
|
|
+ initializeErrCause.add("filePath");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public boolean initilized(){
|
|
|
- return !initilizeErr;
|
|
|
+ public boolean initialized(){
|
|
|
+ return !initializeErr;
|
|
|
}
|
|
|
|
|
|
- public List<String> getInitilizeErrCause(){
|
|
|
- if (initilizeErr)
|
|
|
- return initilizeErrCause;
|
|
|
+ public List<String> getInitializeErrCause(){
|
|
|
+ if (initializeErr)
|
|
|
+ return initializeErrCause;
|
|
|
else
|
|
|
return null;
|
|
|
}
|