@@ -321,8 +327,9 @@ public class IPSReader implements IReader {
// Make sure that we are not at the end of the file
if(!it.hasNext()){
System.err.println(
logger.error(
"IPS Reader Message: Reached unexpected "+"end of file while reading the global configuration.");
createErrorDialog();
returnnull;
}
...
...
@@ -364,8 +371,9 @@ public class IPSReader implements IReader {
// loadGlobalConfiguration() method the current line that the iterator
// is at should be [PORTS]
if(!it.hasNext()){
System.err.println("Reached unexpected end of file while trying to "
logger.error("Reached unexpected end of file while trying to "
+"locate the Ports Table. Please check your input file and "+"try again.");
createErrorDialog();
returnnull;
}
...
...
@@ -382,8 +390,9 @@ public class IPSReader implements IReader {
// in, so make sure that we've not accidentally parsed over the entire
// thing. If we have, tell the user that their file may be incorrect.
if(!it.hasNext()){
System.err.println("Reached unexpected end of file while trying to "+"read the Ports Table. "
logger.error("Reached unexpected end of file while trying to "+"read the Ports Table. "
+"Please check your input file and try again.");
createErrorDialog();
returnnull;
}
...
...
@@ -430,9 +439,10 @@ public class IPSReader implements IReader {
Stringimplementation=line.split(" = ",2)[1];
row.get(1).setValue(implementation);
}else{
System.err.println(
logger.error(
"Unexpected token after ports entry, "+"check your input file and try again.");
System.exit(1);
createErrorDialog();
returnnull;
}
// Found a complete port entry, now remove the port from the
...
...
@@ -446,8 +456,8 @@ public class IPSReader implements IReader {
// Make sure that we are not at the end of the file
if(!it.hasNext()){
System.err
.println("IPS Reader Message: Reached unexpected "+"end of file while reading the ports table.");
logger.error("IPS Reader Message: Reached unexpected "+"end of file while reading the ports table.");
createErrorDialog();
returnnull;
}
...
...
@@ -461,15 +471,27 @@ public class IPSReader implements IReader {
*
* @param it
* Iterator over the lines of the INI file as an ArrayList
* @param fromFile
* True if the iterator is for the file the reader is parsing or false if the iterator is for a standalone set of strings which are to be parsed by themselves.
* @return A DataComponent containing information for one of the port