Modified client visitors to be more efficient and read properly

This commit is contained in:
Obique PSWG
2016-01-31 15:25:47 -06:00
parent b81780dc76
commit 464d305455
10 changed files with 276 additions and 119142 deletions
+8 -3
View File
@@ -35,16 +35,21 @@ import java.io.IOException;
*/
public abstract class DataFactory {
protected ClientData readFile(String file) {
if (file == null || file.isEmpty()) {
protected ClientData readFile(String filename) {
if (filename == null || filename.isEmpty()) {
System.err.println("File cannot be null or empty!");
return null;
}
File file = new File(getFolder() + filename);
if (!file.isFile()) {
System.err.println("Not a file: " + file);
return null;
}
SWGFile swgFile = new SWGFile();
try {
swgFile.read(new File(getFolder() + file));
swgFile.read(file);
} catch (IOException e) {
e.printStackTrace();
}