/** * Read Manifest to get Selenium Version. * @param manifest manifest * @return Selenium Version detected */ public static String getSeleniumVersionFromManifest(Manifest manifest) { String seleniumVersion = null; Attributes buildInfo = manifest.getAttributes("Build-Info"); if (buildInfo != null) { seleniumVersion = buildInfo.getValue("Selenium-Version"); } // Compatibility Selenium > 3.X if(seleniumVersion == null) { Attributes seleniumInfo = manifest.getAttributes("Selenium"); if (seleniumInfo != null) { seleniumVersion = seleniumInfo.getValue("Selenium-Version"); } } return seleniumVersion; } }
private boolean isSealed(Manifest manifest, String dirName) { Attributes attributes = manifest.getAttributes(dirName); if (attributes != null) { String value = attributes.getValue(Attributes.Name.SEALED); if (value != null) { return value.equalsIgnoreCase("true"); } } Attributes mainAttributes = manifest.getMainAttributes(); String value = mainAttributes.getValue(Attributes.Name.SEALED); return (value != null && value.equalsIgnoreCase("true")); }
/** * Returns the {@code Attributes} object associated with this entry or * {@code null} if none exists. * * @return the {@code Attributes} for this entry. * @exception IOException * If an error occurs obtaining the {@code Attributes}. * @see Attributes */ public Attributes getAttributes() throws IOException { if (attributes != null || parentJar == null) { return attributes; } Manifest manifest = parentJar.getManifest(); if (manifest == null) { return null; } return attributes = manifest.getAttributes(getName()); }
@Override protected ZipEntry createZipEntry(String name) { JarEntry entry = new JarEntry(name); if (manifest != null) { entry.setAttributes(manifest.getAttributes(name)); } return entry; } }
protected Object readAttribute(String name, String attrName) { if ("java.io.File".equals(attrName)) { return null; } Attributes attr1 = getManifest().getAttributes(name); try { return (attr1 == null) ? null : attr1.getValue(attrName); } catch (IllegalArgumentException iax) { return null; } }
String getManifestAttribute(String name) { try { Manifest m = getManifest(); if (m == null) { return "??"; } Attributes attrs = m.getAttributes("beeline"); if (attrs == null) { return "???"; } String val = attrs.getValue(name); if (val == null || "".equals(val)) { return "????"; } return val; } catch (Exception e) { e.printStackTrace(errorStream); return "?????"; } }
Attributes attributes = manifest.getAttributes(packageName.replace('.', '/').concat("/")); if (attributes != null) { for (Attributes.Name attributeName : ATTRIBUTE_NAMES) {
URL sealBase = null; Attributes sectionAttributes = manifest.getAttributes(sectionName); if (sectionAttributes != null) { specificationTitle = sectionAttributes.getValue(Name.SPECIFICATION_TITLE);
attr = input.getAttributes(name);
if (manifest.getAttributes(entryName) != null || manifest.getAttributes("./" + entryName) != null || manifest.getAttributes('/' + entryName) != null) inManifest = true;
Attributes attributes = man.getAttributes(name);
mainAttribs = manifest.getAttributes((String)key);
Attributes mainAttributes = manifest.getMainAttributes(); String dirName = packageName.replace('.', '/') + "/"; Attributes packageAttributes = manifest.getAttributes(dirName); boolean noEntry = false; if (packageAttributes == null) {
URL sealBase = null; final Attributes sectionAttributes = manifest.getAttributes(sectionName); if (sectionAttributes != null) { specificationTitle = sectionAttributes.getValue(Name.SPECIFICATION_TITLE);
protected Enumeration<String> attributes(String name) { Attributes attr1 = getManifest().getAttributes(name); if (attr1 != null) { class ToString implements org.openide.util.Enumerations.Processor<Object, String> { public String process(Object obj, Collection<Object> ignore) { return obj.toString(); } } return org.openide.util.Enumerations.convert(Collections.enumeration(attr1.keySet()), new ToString()); } else { return org.openide.util.Enumerations.empty(); } }
final Attributes mainAttributes; if (manifest != null) { fileAttributes = manifest.getAttributes(classResourceName); mainAttributes = manifest.getMainAttributes(); } else {
import java.util.jar.*; ... JarFile myJar = new JarFile("nameOfJar.jar"); // various constructors available Manifest manifest = myJar.getManifest(); Map<String,Attributes> manifestContents = manifest.getAttributes();
Attributes ourSection = target.getAttributes( o.getKey() ); Attributes otherSection = o.getValue(); if ( ourSection == null )
private boolean isSealed(Manifest manifest, String dirName) { Attributes attributes = manifest.getAttributes(dirName); if (attributes != null) { String value = attributes.getValue(Attributes.Name.SEALED); if (value != null) { return value.equalsIgnoreCase("true"); } } Attributes mainAttributes = manifest.getMainAttributes(); String value = mainAttributes.getValue(Attributes.Name.SEALED); return (value != null && value.equalsIgnoreCase("true")); }
protected Attributes findManifestSection(String name) { try { URL inputStreamURL = this.getClass().getProtectionDomain().getCodeSource().getLocation(); JarFile jarFile = new JarFile(inputStreamURL.getFile()); java.util.jar.Manifest manifest = jarFile.getManifest(); return manifest.getAttributes(name); } catch (Exception e) { e.printStackTrace(); } return null; } }