Removed fixme by logging problem.

This commit is contained in:
Kevin Ruland 2012-08-23 02:26:55 +00:00
parent 086d9b37dc
commit 8219e5cd31

View File

@ -13,6 +13,7 @@ import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.List; import java.util.List;
/** /**
@ -20,6 +21,8 @@ import java.util.List;
*/ */
public abstract class RocksimComponentFileLoader { public abstract class RocksimComponentFileLoader {
private static final PrintStream LOGGER = System.err;
private String basePath = ""; private String basePath = "";
private File dir; private File dir;
@ -49,7 +52,11 @@ public abstract class RocksimComponentFileLoader {
protected abstract RocksimComponentFileType getFileType(); protected abstract RocksimComponentFileType getFileType();
public void load() { public void load() {
try {
load(getFileType()); load(getFileType());
} catch (FileNotFoundException fex ) {
LOGGER.println( fex.getLocalizedMessage() );
}
} }
/** /**
@ -62,7 +69,7 @@ public abstract class RocksimComponentFileLoader {
* component data file; the element in the list itself is an array of String, where each item in the array * component data file; the element in the list itself is an array of String, where each item in the array
* is a column (cell) in the row. The string array is in sequential order as it appeared in the file. * is a column (cell) in the row. The string array is in sequential order as it appeared in the file.
*/ */
private void load(RocksimComponentFileType type) { private void load(RocksimComponentFileType type) throws FileNotFoundException {
if (!dir.exists()) { if (!dir.exists()) {
throw new IllegalArgumentException(basePath + " does not exist"); throw new IllegalArgumentException(basePath + " does not exist");
} }
@ -72,14 +79,9 @@ public abstract class RocksimComponentFileLoader {
if (!dir.canRead()) { if (!dir.canRead()) {
throw new IllegalArgumentException(basePath + " is not readable"); throw new IllegalArgumentException(basePath + " is not readable");
} }
try {
FileInputStream fis = new FileInputStream(new File(dir, type.getDefaultFileName())); FileInputStream fis = new FileInputStream(new File(dir, type.getDefaultFileName()));
load(fis); load(fis);
} }
catch (FileNotFoundException ex) {
// FIXME?
}
}
/** /**
* Read a comma separated component file and return the parsed contents as a list of string arrays. * Read a comma separated component file and return the parsed contents as a list of string arrays.