private static File getDefaultMetadataFile(final Path dataDir) throws IOException {
    File metaDataFile = dataDir.resolve(METADATA_FILENAME).toFile();

    // Create the data dir here if it doesn't exist yet
    if (!metaDataFile.getParentFile().exists()) {
      LOG.info("Data directory {} does not exist - creating it", dataDir);
      boolean created = metaDataFile.getParentFile().mkdirs();
      if (!created) {
        throw new IOException("Failed to create data directory: " + dataDir);
      }
    }
    if (!metaDataFile.getParentFile().canWrite()) {
      throw new IOException("Data directory is not writable: " + dataDir);
    }
    return metaDataFile;
  }
Get the version of Besu that is running.

@return the version of Besu
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/VersionMetadata.java