code: public long getLogFileTimestamp(File file) {
          if (file == null) {
              return -1L;
          }
  
          String name = file.getName();
  
          // Check name for extension
          if (name == null || name.length() == 0 || !name.endsWith(EXTENSION)) {
              return -1L;
          }
  
          try {
              return Long.parseLong(name.substring(0, name.indexOf(EXTENSION)));
          } catch (NumberFormatException ex) {
              return -1L;
          }
      }
docs: Retrieves the timestamp from the name of the file.
  
  @param file to retrieve timestamp from.
  @return timestamp in millis or -1 if name's pattern does not correspond
  to the one used for files in the repository.