Get the version strategy that can retrieve the data file version from the end point.

@return the version strategy. Empty value when the version is not supported for this end point.
325678
private Optional<DataFileVersionStrategy> initDataFileVersionStrategy(EndPoint endPoint, ReplicationConfiguration rc, Properties props) {

    // rc is the dataset config???
    if (!(endPoint instanceof HadoopFsEndPoint)) {
      log.warn("Data file version currently only handle the Hadoop Fs EndPoint replication");
      return Optional.absent();
    }
    Configuration conf = HadoopUtils.newConfiguration();
    try {
      HadoopFsEndPoint hEndpoint = (HadoopFsEndPoint) endPoint;
      FileSystem fs = FileSystem.get(hEndpoint.getFsURI(), conf);

      // If configStore doesn't contain the strategy, check from job properties.
      // If no strategy is found, default to the modification time strategy.
      this.versionStrategyFromCS = rc.getVersionStrategyFromConfigStore();
      String nonEmptyStrategy = versionStrategyFromCS.isPresent()? versionStrategyFromCS.get() :
          props.getProperty(DataFileVersionStrategy.DATA_FILE_VERSION_STRATEGY_KEY, DataFileVersionStrategy.DEFAULT_DATA_FILE_VERSION_STRATEGY);
      Config versionStrategyConfig = ConfigFactory.parseMap(ImmutableMap.of(
          DataFileVersionStrategy.DATA_FILE_VERSION_STRATEGY_KEY, nonEmptyStrategy));

      DataFileVersionStrategy strategy = DataFileVersionStrategy.instantiateDataFileVersionStrategy(fs, versionStrategyConfig);
      log.debug("{} has version strategy {}", hEndpoint.getClusterName(), strategy.getClass().getName());
      return Optional.of(strategy);
    } catch (IOException e) {
      log.error("Version strategy cannot be created due to {}", e);
      return Optional.absent();
    }
  }
1259833
public int getVersion() {

    Element versionElement = (Element) xmlResponse.getElementsByTagName(
      "version").item(0);

    if (versionElement == null) {

      return 0;
    }

    return Integer.parseInt(versionElement.getFirstChild().getNodeValue());
  }
1173587
public static String getVersion()
    {

        URL versionFile = SnappyLoader.class
                .getResource("/META-INF/maven/org.xerial.snappy/snappy-java/pom.properties");
        if (versionFile == null) {
            versionFile = SnappyLoader.class.getResource("/org/xerial/snappy/VERSION");
        }

        String version = "unknown";
        try {
            if (versionFile != null) {
                Properties versionData = new Properties();
                versionData.load(versionFile.openStream());
                version = versionData.getProperty("version", version);
                if (version.equals("unknown")) {
                    version = versionData.getProperty("SNAPPY_VERSION", version);
                }
                version = version.trim().replaceAll("[^0-9M\\.]", "");
            }
        }
        catch (IOException e) {
            System.err.println(e);
        }
        return version;
    }
135390
private String getProjectVersion() {
        return Utils.convertToDebianVersion(getProject().getVersion(), this.snapshotExpand, this.snapshotEnv, this.snapshotTemplate, session.getStartTime());
    }
955680
public static RevisionInformation getRevisionInformation() {
		String revision = UNKNOWN;
		String commitDate = UNKNOWN;
		try (InputStream propFile = EnvironmentInformation.class.getClassLoader().getResourceAsStream(".version.properties")) {
			if (propFile != null) {
				Properties properties = new Properties();
				properties.load(propFile);
				String propRevision = properties.getProperty("git.commit.id.abbrev");
				String propCommitDate = properties.getProperty("git.commit.time");
				revision = propRevision != null ? propRevision : UNKNOWN;
				commitDate = propCommitDate != null ? propCommitDate : UNKNOWN;
			}
		} catch (Throwable t) {
			if (LOG.isDebugEnabled()) {
				LOG.debug("Cannot determine code revision: Unable to read version property file.", t);
			} else {
				LOG.info("Cannot determine code revision: Unable to read version property file.");
			}
		}
		
		return new RevisionInformation(revision, commitDate);
	}
1057354
public static String getVersion() {
        String version = null;

        // try to load from maven properties first
        try {
            Properties p = new Properties();
            InputStream is = VersionHelper.class.getResourceAsStream("/META-INF/maven/io.redlink/redlink-sdk-java/pom.properties");
            if (is != null) {
                p.load(is);
                version = p.getProperty("version", "");
            }
        } catch (Exception e) {
            // ignore
        }

        // fallback to using Java API
        if (version == null) {
            Package aPackage = VersionHelper.class.getPackage();
            if (aPackage != null) {
                version = aPackage.getImplementationVersion();
                if (version == null) {
                    version = aPackage.getSpecificationVersion();
                }
            }
        }

        // fallback to read pom.xml on testing
        if (version == null) {
            final MavenXpp3Reader reader = new MavenXpp3Reader();
            try {
                Model model = reader.read(new FileReader(new File("pom.xml")));
                version = model.getVersion();
            } catch (IOException | XmlPullParserException e) {
                // ignore
            }
        }

        return version;
    }
1273955
@Override
	public VersionInfo version() {
		return credHubOperations.doWithRest(restOperations -> {
			ResponseEntity<VersionInfo> response = restOperations
					.getForEntity(VERSION_URL_PATH, VersionInfo.class);

			ExceptionUtils.throwExceptionOnError(response);

			return response.getBody();
		});
	}
797559
public static int getVersionAsInteger() {
        StringTokenizer stk = new StringTokenizer(revNumber);
        String release = null;
        for (int i=0 ; stk.hasMoreTokens() ; i++) {
            String s = stk.nextToken();
            if (i==1) {
                release = s;
                break;
            }
        }
        stk = new StringTokenizer(release, ".");
        release = "";
        while (stk.hasMoreTokens()) {
            release += stk.nextToken();
        }
        int version = 0;
        try {
            version = Integer.parseInt(release);
        } catch (NumberFormatException e) {
            //
        }
        return version;
    }
1038963
private function getVersion(): ?Version
    {
        // Oops, unknown/empty path of a file who contains version
        if (empty($this->versionFilePath)) {
            throw EmptyVersionFilePathException::create();
        }

        // Oops, not readable/accessible file who contains version
        if (!is_readable($this->versionFilePath)) {
            throw UnreadableVersionFileException::create($this->versionFilePath);
        }

        $contents = file_get_contents($this->versionFilePath);

        return Version::fromString($contents);
    }
1304276
public Version getVersion(String rawVersion)
    {
        Version version = this.versions.get(rawVersion);

        if (version == null) {
            version = new DefaultVersion(rawVersion);

            this.versions.put(rawVersion, version);
        }

        return version;
    }
1361945
private String getVersion(boolean verbose) {
        try {
            InputStream stream = getClass().getResourceAsStream("/version.properties");
            Properties props = new Properties();
            props.load(stream);
            if (verbose) {
                return String.format("Version=%s, build date=%s",
                        props.getProperty("version"),
                        props.getProperty("buildDate"));
            } else {
                return props.getProperty("version");
            }
        } catch (IOException e) {
            log.error("Unable to retrieve version", e);
            return "unknown";
        }
    }
1220430
public VersionComparator getSchemaVersion() {
        PreparedStatement statement = null;
        ResultSet results = null;
        try {
            statement = connection.prepareStatement("SELECT \"VERSION\" FROM \"SCHEMAVERSION\"");
            results = statement.executeQuery();

            if (results.next()) {
                return new VersionComparator(results.getString(1));
            }
        } catch (SQLException e) {
            // throw it away
        } finally {
            DbUtil.close(results);
            DbUtil.close(statement);
            //DbUtil.close(connection); // do not close connection
        }
        return null;
    }
926218
public static String getAppVersion() {
        if (appVersion != null)
            return appVersion;

        String appName = getAppId();
        if ("mdw".equalsIgnoreCase(appName)) {
            appVersion = getMdwVersion();
        }
        else {
            appVersion = "Unknown";
            try {
                InputStream stream = ApplicationContext.class.getClassLoader().getResourceAsStream(BUILD_VERSION_FILE);
                if (stream != null) {
                    appVersion = "";
                    int i;
                    while ((i = stream.read()) != -1) {
                        appVersion += (char) i;
                    }
                    stream.close();
                }
            }
            catch (Exception ex) {
                logger.severeException(ex.getMessage(), ex);
            }
        }

        return appVersion;
    }
172047
@Exported
    public String getBackupVersion() {
        File backup = getBackupFile();
        if (backup.exists()) {
            try {
                try (JarFile backupPlugin = new JarFile(backup)) {
                    return backupPlugin.getManifest().getMainAttributes().getValue("Plugin-Version");
                }
            } catch (IOException e) {
                LOGGER.log(WARNING, "Failed to get backup version from " + backup, e);
                return null;
            }
        } else {
            return null;
        }
    }
169272
private VersionControl getAssetVersionControl() throws IOException, DataAccessException {
        VersionControl vc = getVersionControl();
        if (vc == null)
            vc = DataAccess.getAssetVersionControl(assetRoot);
        return vc;
    }
981124
public long getVersion() {
    long version = 1;

    ArrayList<String> indices = new ArrayList<>(getIndices().keySet());
    Collections.sort(indices);
    for (String index : indices) {
      version = 31 * version + getIndices().get(index);
    }

    return version;
  }
516968
public static String getFormatVersion(File filename) {
		final ContentFileTypeMap map = ensureContentTypeManager();
		return map.getFormatVersion(filename);
	}