コード例 #1
0
  protected void restore(T object) throws IOException {

    logger.debug(
        "Restoring object [{}] from [{}]", object.getClass().toString(), persistenceFile.getName());

    if (persistenceFile.exists()) {
      String objectString = StringTools.fileToString(persistenceFile, PERSISTENCE_FILE_ENCODING);
      object.fromPersistence(objectString);
    } else {
      logger.warn("Persistance file [{}] not found", persistenceFile.getName());
    }
  }