public String getImplementationVendor() { return getSpecificationVendor(); }
/** * Returns the specification vendor. * * @return The specification vendor. */ public static String getSpecVendor() { Package versionPackage = Version.class.getPackage(); return versionPackage.getSpecificationVendor(); }
/** * Returns the specification vendor. * * @return The specification vendor. */ public static String getSpecVendor() { Package versionPackage = Version.class.getPackage(); return versionPackage.getSpecificationVendor(); }
public void getSDKInfo() { Package pkg = Manifest.class.getPackage(); String specTitle = pkg.getSpecificationTitle(); String vendor = pkg.getSpecificationVendor(); String version = pkg.getSpecificationVersion(); }
Package myPackage = Manifest.class.getPackage(); String specTitle = myPackage.getSpecificationTitle(); String vendor = myPackage.getSpecificationVendor(); String virsion = myPackage.getSpecificationVersion();
public class TheVersionClass { public TheVersionClass() { System.out.println( " Implementation Title:" + this.getClass().getPackage().getImplementationTitle() ); System.out.println( " Implementation Vendor:" + this.getClass().getPackage().getImplementationVendor() ); System.out.println( "Implementation Version:" + this.getClass().getPackage().getImplementationVersion() ); System.out.println( " Specification Tile:" + this.getClass().getPackage().getSpecificationTitle() ); System.out.println( " Specification Vendor:" + this.getClass().getPackage().getSpecificationVendor() ); System.out.println( " Specification Version:" + this.getClass().getPackage().getSpecificationVersion() ); } }
public static String getVersion() { return DigiMorph.class.getPackage().getImplementationTitle() + "\n" + DigiMorph.class.getPackage().getSpecificationVendor() + " - " + DigiMorph.class.getPackage().getImplementationVendor() + "\n" + "Version: " + DigiMorph.class.getPackage().getSpecificationVersion(); }
public static String getVersion() { return DigiMorph.class.getPackage().getImplementationTitle() + "\n" + DigiMorph.class.getPackage().getSpecificationVendor() + " - " + DigiMorph.class.getPackage().getImplementationVendor() + "\n" + "Version: " + DigiMorph.class.getPackage().getSpecificationVersion(); }
/** * Prints the version of this library to System.out along with * some information on what this jar is. */ public static String getVersionInfo() { final Class<?> c = Version.class; final StringBuilder b = new StringBuilder(); final Package p = c.getPackage(); b.append("Class: " + c.getCanonicalName() + "; "); b.append("Specification Vendor: " + p.getSpecificationVendor() + "; "); b.append("Specification Title: " + p.getSpecificationTitle() + "; "); b.append("Specification Version: " + p.getSpecificationVersion() + "; "); b.append("Implementation Vendor: " + p.getImplementationVendor() + "; "); b.append("Implementation Title: " + p.getImplementationTitle() + "; "); b.append("Implementation Version: " + p.getImplementationVersion() + ";"); return b.toString(); }
/** * Prints the version of this library to System.out along with * some information on what this jar is. */ public static String getVersionInfo() { final Class<?> c = Version.class; final StringBuilder b = new StringBuilder(); final Package p = c.getPackage(); b.append("Class: " + c.getCanonicalName() + "; "); b.append("Specification Vendor: " + p.getSpecificationVendor() + "; "); b.append("Specification Title: " + p.getSpecificationTitle() + "; "); b.append("Specification Version: " + p.getSpecificationVersion() + "; "); b.append("Implementation Vendor: " + p.getImplementationVendor() + "; "); b.append("Implementation Title: " + p.getImplementationTitle() + "; "); b.append("Implementation Version: " + p.getImplementationVersion() + ";"); return b.toString(); }
/** * Prints the version of this library to System.out along with * some information on what this jar is. */ public static String getVersionInfo() { final Class<?> c = Version.class; final StringBuilder b = new StringBuilder(); final Package p = c.getPackage(); b.append("Class: " + c.getCanonicalName() + "; "); b.append("Specification Vendor: " + p.getSpecificationVendor() + "; "); b.append("Specification Title: " + p.getSpecificationTitle() + "; "); b.append("Specification Version: " + p.getSpecificationVersion() + "; "); b.append("Implementation Vendor: " + p.getImplementationVendor() + "; "); b.append("Implementation Title: " + p.getImplementationTitle() + "; "); b.append("Implementation Version: " + p.getImplementationVersion() + ";"); return b.toString(); }
private void printVersion() { String pkgName = "net.jangaroo.jooc"; Package pkg = Package.getPackage(pkgName); String specTitle = pkg.getSpecificationTitle(); if (specTitle == null) { System.out.println("cannot retrieve package version information for " + pkgName); // NOSONAR this is a commandline tool return; } String specVendor = pkg.getSpecificationVendor(); String specVersion = pkg.getSpecificationVersion(); String implTitle = pkg.getImplementationTitle(); String implVersion = pkg.getImplementationVersion(); System.out.println(specTitle + " version " + specVersion); // NOSONAR this is a cmd line tool System.out.println(implTitle + " (build " + implVersion + ")"); // NOSONAR this is a cmd line tool System.out.println(specVendor); // NOSONAR this is a cmd line tool }
public void invoke() throws Exception { Package pkg; pkg = getClass().getPackage(); if (pkg == null) { console.info.println("unknown version"); } else { console.info.println(pkg.getName()); console.info.println(" specification title: " + pkg.getSpecificationTitle()); console.info.println(" specification version: " + pkg.getSpecificationVersion()); console.info.println(" specification vendor: " + pkg.getSpecificationVendor()); console.info.println(" implementation title: " + pkg.getImplementationTitle()); console.info.println(" implementation version: " + pkg.getImplementationVersion()); console.info.println(" implementation vendor: " + pkg.getImplementationVendor()); } console.verbose.println("Platform encoding: " + System.getProperty("file.encoding")); console.verbose.println("Default Locale: " + Locale.getDefault()); console.verbose.println("Scanner Locale: " + console.input.locale()); } };
public void run() { Package pkg; pkg = getClass().getPackage(); if (pkg == null) { console.info.println("unknown version"); } else if (console.getVerbose()) { console.verbose.println(pkg.getName()); console.verbose.println(" specification title: " + pkg.getSpecificationTitle()); console.verbose.println(" specification version: " + pkg.getSpecificationVersion()); console.verbose.println(" specification vendor: " + pkg.getSpecificationVendor()); console.verbose.println(" implementation title: " + pkg.getImplementationTitle()); console.verbose.println(" implementation version: " + pkg.getImplementationVersion()); console.verbose.println(" implementation vendor: " + pkg.getImplementationVendor()); console.verbose.println(); console.verbose.println("Java Version: " + System.getProperty("java.version")); console.verbose.println("Platform encoding: " + System.getProperty("file.encoding")); console.verbose.println("Default Locale: " + Locale.getDefault()); console.verbose.println("Scanner Locale: " + console.input.locale()); } else { console.info.println(pkg.getSpecificationVersion()); } } }
private void setPackage(String location) { Package pack = Package.getPackage(location); if (pack == null) { logger.warn("can,t find AppInfo"); return; } appVersion = pack.getImplementationVersion(); this.specificationTitle = pack.getSpecificationTitle(); this.specificationVersion = pack.getSpecificationVersion(); this.specificationVendor = pack.getSpecificationVendor(); this.implementationTitle = pack.getImplementationTitle(); this.implementationVersion = pack.getImplementationVersion(); this.implementationVendor = pack.getImplementationVendor(); }
/** * Get information about this applet. * * @return Information about this applet. */ @Override public String getAppletInfo() { Object builderFactory = ApfloatContext.getContext().getBuilderFactory(); Package specificationPackage = Package.getPackage("org.apfloat"), implementationPackage = builderFactory.getClass().getPackage(); String lineSeparator = System.getProperty("line.separator"); return "Pi calculation applet" + lineSeparator + "Written by Mikko Tommila 2002 - 2017" + lineSeparator + "Specification-Title: " + specificationPackage.getSpecificationTitle() + lineSeparator + "Specification-Version: " + specificationPackage.getSpecificationVersion() + lineSeparator + "Specification-Vendor: " + specificationPackage.getSpecificationVendor() + lineSeparator + "Implementation-Title: " + implementationPackage.getImplementationTitle() + lineSeparator + "Implementation-Version: " + implementationPackage.getImplementationVersion() + lineSeparator + "Implementation-Vendor: " + implementationPackage.getImplementationVendor() + lineSeparator + "Java version: " + System.getProperty("java.version") + lineSeparator + "Java Virtual Machine: " + System.getProperty("java.vm.name"); } }
WelcomeStatus(final GenericServer server, final Boolean showProperties, final Boolean showEnvVars) throws IOException { this.webapp_endpoints = server == null ? null : server.getWebAppEndPoints(); this.webservice_endpoints = server == null ? null : server.getWebServiceEndPoints(); final Package pkg = getClass().getPackage(); implementation = new TitleVendorVersion(pkg.getImplementationTitle(), pkg.getImplementationVendor(), pkg.getImplementationVersion()); specification = new TitleVendorVersion(pkg.getSpecificationTitle(), pkg.getSpecificationVendor(), pkg.getSpecificationVersion()); memory = new MemoryStatus(); file_stores = new LinkedHashMap<>(); for (Path rootDir : FileSystems.getDefault().getRootDirectories()) { if (!Files.isReadable(rootDir)) continue; final FileStore fileStore = Files.getFileStore(rootDir); if (fileStore.getTotalSpace() > 0) file_stores.put(rootDir.toString(), new DiskStatus(fileStore)); } runtime = new RuntimeStatus(); if (showProperties != null && showProperties) { properties = new TreeMap<>(); System.getProperties().forEach((key, value) -> properties.put(key.toString(), value)); } else properties = null; if (showEnvVars != null && showEnvVars) env = new TreeMap<>(System.getenv()); else env = null; }
private static void initFromPackage(PackageDescriptor pd, Package pkg) { pd.setExists(true); String specificationTitle = pkg.getSpecificationTitle(); String specificationVersion = pkg.getSpecificationVersion(); String specificationVendor = pkg.getSpecificationVendor(); String implementationTitle = pkg.getImplementationTitle(); String implementationVersion = pkg.getImplementationVersion(); String implementationVendor = pkg.getImplementationVendor(); if (implementationTitle == null) { implementationTitle = specificationTitle; } if (implementationVersion == null) { implementationVersion = specificationVersion; } if (implementationVendor == null) { implementationVendor = specificationVendor; } pd.setSpecificationTitle(specificationTitle); pd.setSpecificationVersion(specificationVersion); pd.setSpecificationVendor(specificationVendor); pd.setImplementationTitle(implementationTitle); pd.setImplementationVersion(implementationVersion); pd.setImplementationVendor(implementationVendor); pd.setProduct(implementationTitle); pd.setProductVersion(implementationVersion); }
/** * Verify the package loaded with class loader. */ private void verifyPackage(final Package pack, final boolean sealed) { if (getBaseFolder().getFileSystem().hasCapability(Capability.MANIFEST_ATTRIBUTES)) { assertEquals("ImplTitle", pack.getImplementationTitle()); assertEquals("ImplVendor", pack.getImplementationVendor()); assertEquals("1.1", pack.getImplementationVersion()); assertEquals("SpecTitle", pack.getSpecificationTitle()); assertEquals("SpecVendor", pack.getSpecificationVendor()); assertEquals("1.0", pack.getSpecificationVersion()); assertEquals(sealed, pack.isSealed()); } else { assertNull(pack.getImplementationTitle()); assertNull(pack.getImplementationVendor()); assertNull(pack.getImplementationVersion()); assertNull(pack.getSpecificationTitle()); assertNull(pack.getSpecificationVendor()); assertNull(pack.getSpecificationVersion()); assertFalse(pack.isSealed()); } }
/** * Verify the package loaded with class loader. */ private void verifyPackage(final Package pack, final boolean sealed) { if (getBaseFolder().getFileSystem().hasCapability(Capability.MANIFEST_ATTRIBUTES)) { assertEquals("ImplTitle", pack.getImplementationTitle()); assertEquals("ImplVendor", pack.getImplementationVendor()); assertEquals("1.1", pack.getImplementationVersion()); assertEquals("SpecTitle", pack.getSpecificationTitle()); assertEquals("SpecVendor", pack.getSpecificationVendor()); assertEquals("1.0", pack.getSpecificationVersion()); assertEquals(sealed, pack.isSealed()); } else { assertNull(pack.getImplementationTitle()); assertNull(pack.getImplementationVendor()); assertNull(pack.getImplementationVersion()); assertNull(pack.getSpecificationTitle()); assertNull(pack.getSpecificationVendor()); assertNull(pack.getSpecificationVersion()); assertFalse(pack.isSealed()); } }