code: private File getNextFileForEvent(File dir, Calendar timestamp, int counter) {
          long timestampInMillis = timestamp.getTimeInMillis();
          String name = Long.toString(timestampInMillis);
          return new File(dir, name + "." + counter);
      }
docs: Gets the file to use for a new event in the given collection with the given timestamp,
  using the provided counter.
  
  @param dir       The directory in which the file should be created.
  @param timestamp The timestamp to use as the base file name.
  @param counter   The counter to append to the file name.
  @return The file to use.