Code example for FileWriter

Methods: close, flush, write

0
 
    if (!scnFile.createNewFile())
    { 
      LOG.error("unable to create new SCN file:" + scnFile.getAbsolutePath());
    } 
    FileWriter writer = new FileWriter(scnFile);
    writer.write(Long.toString(scn));
    writer.write(SCN_SEPARATOR + new Date().toString());
    writer.flush();
    writer.close();
    LOG.debug("scn persisted: " + scn);
  } 
 
  @Override 
  public long getMaxScn() 
  { 
    return _scn.get();
  } 
 
  @Override 
  public void saveMaxScn(long endOfPeriod) throws DatabusException