Beispiel #1
0
 /**
  * Generates a file name for the call based on the current date and the names of the peers in the
  * call.
  *
  * @param ext file extension
  * @return the file name for the call
  */
 private String generateCallFilename(String ext) {
   String filename = FORMAT.format(new Date()) + "-call";
   int maxLength = MAX_FILENAME_LENGTH - 2 - filename.length() - ext.length();
   String peerName = getCallPeerName(maxLength);
   filename += ((!peerName.equals("")) ? "-" : "") + peerName + "." + ext;
   return filename;
 }
  /**
   * Returns the directory where the recording should be stored
   *
   * @return the directory of the new recording
   */
  String getRecordingDirectory() {
    if (this.recordingDirectory == null) {
      SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd.HH-mm-ss.");
      this.recordingDirectory =
          dateFormat.format(new Date()) + getID() + ((name != null) ? "_" + name : "");
    }

    return this.recordingDirectory;
  }
  /** Adds recent message in history. */
  private void saveRecentMessageToHistory(ComparableEvtObj msc) {
    synchronized (historyID) {
      // and create it
      try {
        History history = getHistory();
        HistoryWriter writer = history.getWriter();

        SimpleDateFormat sdf = new SimpleDateFormat(HistoryService.DATE_FORMAT);

        writer.addRecord(
            new String[] {
              msc.getProtocolProviderService().getAccountID().getAccountUniqueID(),
              msc.getContactAddress(),
              sdf.format(msc.getTimestamp()),
              RECENT_MSGS_VER
            },
            NUMBER_OF_MSGS_IN_HISTORY);
      } catch (IOException ex) {
        logger.error("cannot create recent_messages history", ex);
        return;
      }
    }
  }