public void store(String filenameToSave,String comments) throws FileNotFoundException, FileAlreadyExistsException {
  if (StringUtils.isEmpty(filenameToSave)) {
    throw new FileNotFoundException();
  }
  if (filenameToSave.equals(filename)) {
    throw new FileAlreadyExistsException(filenameToSave);
  }
  FileWriter fileWriter=null;
  BufferedWriter bufferedWriter=null;
  try {
    fileWriter=new FileWriter(filenameToSave,false);
    bufferedWriter=new BufferedWriter(fileWriter);
    prop.store(bufferedWriter,comments);
  }
 catch (  IOException e) {
    logger.error("Fail on store properties.",e);
  }
 finally {
    IOUtils.closeQuite(fileWriter);
    IOUtils.closeQuite(bufferedWriter);
  }
}

public void store ( String filenameToSave , String comments ) throws FileNotFoundException , FileAlreadyExistsException { if ( StringUtils . isEmpty ( filenameToSave ) ) { throw new FileNotFoundException ( ) ; } if ( filenameToSave . equals ( filename ) ) { throw new FileAlreadyExistsException ( filenameToSave ) ; } FileWriter fileWriter = null ; BufferedWriter bufferedWriter = null ; try { fileWriter = new FileWriter ( filenameToSave , false ) ; bufferedWriter = new BufferedWriter ( fileWriter ) ; prop . store ( bufferedWriter , comments ) ; } catch ( IOException e ) { logger . error ( "Fail on store properties." , e ) ; } finally { IOUtils . closeQuite ( fileWriter ) ; IOUtils . closeQuite ( bufferedWriter ) ; } }
store current properties to file . always overwrite .
