code: private File rollFile() throws IOException {
          // If the base file exists, rename it and recreate it.
          File file = new File(directory, fileName + fileExtension);
          if (file.isFile()) {
              // Reuse the file if it's already empty.
              if (file.length() == 0) {
                  return file;
              }
  
              if (maxFiles == 1) {
                  if (!FileLogUtils.deleteFile(file)) {
                      // We failed to delete the file and issued a message.
                      return file;
                  }
              } else if (createNewUniqueFile(file) == null) {
                  // We failed to rename (or copy + delete) the base file to a new
                  // file, and we already issued a message.
                  return file;
              }
          }
  
          if (!file.createNewFile()) {
              Tr.error(tc, "UNABLE_TO_DELETE_RESOURCE_NOEX", new Object[] { file });
          }
  
          return file;
      }
docs: Attempt to rename the base log file to a new log file, and then recreate
  the base log file.
  
  @return the base log file