Exemplo n.º 1
0
 /**
  * A non-null file name indicates that recording be enabled. The file must also be present and
  * have the appropriate permissions.
  *
  * @param file
  */
 public void record(final File file) {
   if (file == null) {
     majorLogger.info("no recorder file specified");
     return;
   }
   if (file.exists()) {
     majorLogger.warn("the recorder file is being overwritten", file);
     if (!file.canWrite()) {
       majorLogger.warn("the recorder file path provided is not writable: {}", file);
       return;
     }
   }
   final SyntheticData.Recorder old = this.recorder.getAndSet(new SyntheticData.Recorder(file));
   if (old != null) {
     old.stopRecording();
   }
 }