Here you can find the source of formatDisplay(String src, Manifest manifest)
Parameter | Description |
---|---|
src | source string to append info to |
manifest | jar manifest file that contains vendor and version info. |
private static String formatDisplay(String src, Manifest manifest)
//package com.java2s; import java.util.jar.Manifest; public class Main { public static final String ATT_VERSION = "Implementation-Version"; public static final String ATT_VENDOR = "Implementation-Vendor"; /**//from w ww. j a va2 s . c o m * Given a manifest, it appends vendor and version information to a given * source string * @param src source string to append info to * @param manifest jar manifest file that contains vendor and version info. * @return src string + appended version and vendor info. */ private static String formatDisplay(String src, Manifest manifest) { String version = manifest.getMainAttributes().getValue(ATT_VERSION); String vendor = manifest.getMainAttributes().getValue(ATT_VENDOR); if (version == null) version = "NA"; if (vendor == null) vendor = "NA"; return (src + ": " + version + " (c) " + vendor + "\n"); } }