|
|
|
@ -67,17 +67,9 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
|
|
|
|
|
try{ |
|
|
|
|
ObjectInputStream is = new ObjectInputStream(new FileInputStream(getInfoFile())); |
|
|
|
|
instance = (TemplateInfoCollector) is.readObject(); |
|
|
|
|
} catch (FileNotFoundException ex) { |
|
|
|
|
// 如果之前没有存储过,则创建新对象
|
|
|
|
|
instance = new TemplateInfoCollector(); |
|
|
|
|
} catch (InvalidClassException ex) { |
|
|
|
|
// 如果 TemplateInfoCollecor 类结构有改动,则放弃之前收集的数据(下次保存时覆盖)
|
|
|
|
|
// 这种情况主要在开发、测试过程中遇到,正式上线后不应该出现
|
|
|
|
|
} catch (Exception ex) { |
|
|
|
|
instance = new TemplateInfoCollector(); |
|
|
|
|
} |
|
|
|
|
catch (Exception ex) { |
|
|
|
|
FRLogger.getLogger().error(ex.getMessage(), ex); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return instance; |
|
|
|
|
} |
|
|
|
|