MCPcopy Index your code
hub / github.com/apache/orc / getOrcVersion

Method getOrcVersion

java/core/src/java/org/apache/orc/OrcUtils.java:477–503  ·  view source on GitHub ↗

Get the software version from Maven. @return The version of the software.

()

Source from the content-addressed store, hash-verified

475 * @return The version of the software.
476 */
477 public static String getOrcVersion() {
478 Class<OrcFile> cls = OrcFile.class;
479 // try to load from maven properties first
480 try (InputStream is = cls.getResourceAsStream(
481 "/META-INF/maven/org.apache.orc/orc-core/pom.properties")) {
482 if (is != null) {
483 Properties p = new Properties();
484 p.load(is);
485 String version = p.getProperty("version", null);
486 if (version != null) {
487 return version;
488 }
489 }
490 } catch (IOException e) {
491 // ignore
492 }
493
494 // fallback to using Java API
495 Package aPackage = cls.getPackage();
496 if (aPackage != null) {
497 String version = aPackage.getImplementationVersion();
498 if (version != null) {
499 return version;
500 }
501 }
502 return "unknown";
503 }
504}

Callers 1

writeFooterMethod · 0.95

Calls 1

loadMethod · 0.80

Tested by

no test coverage detected