本文整理了Java中java.util.jar.Attributes.containsValue()
方法的一些代码示例,展示了Attributes.containsValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Attributes.containsValue()
方法的具体详情如下:
包路径:java.util.jar.Attributes
类名称:Attributes
方法名:containsValue
[英]Determines whether this Attributes contains the specified value.
[中]确定此属性是否包含指定的值。
代码示例来源:origin: liimaorg/liima
private Manifest getBusinessManifest(String module){
Manifest manifest = null;
Enumeration<URL> resources = null;
try {
resources = getClass().getClassLoader().getResources("META-INF/MANIFEST.MF");
}
catch (IOException e) {
log.log(Level.SEVERE, "Not able to load META-INF/MANIFEST.MF", e);
}
if(resources != null){
while (resources.hasMoreElements()) {
try {
manifest = new Manifest(resources.nextElement().openStream());
Attributes attributes = manifest.getMainAttributes();
if(attributes != null && attributes.containsValue(module)){
return manifest;
}
} catch (IOException e) {
log.log(Level.SEVERE, "Not able to load META-INF/MANIFEST.MF", e);
}
}
}
return manifest;
}
代码示例来源:origin: org.projectodd.shrinkwrap.descriptors/shrinkwrap-descriptors-impl-base
public ManifestDescriptorImpl(String descriptorName, ManifestModel manifest) {
this.descriptorName = descriptorName;
this.manifest = manifest;
// Export requires a manifest main version
if (!manifest.getMainAttributes().containsValue(Name.MANIFEST_VERSION))
manifest.getMainAttributes().put(Name.MANIFEST_VERSION, "1.0");
}
代码示例来源:origin: org.jboss.shrinkwrap.descriptors/shrinkwrap-descriptors-impl-base
public ManifestDescriptorImpl(String descriptorName, ManifestModel manifest) {
this.descriptorName = descriptorName;
this.manifest = manifest;
// Export requires a manifest main version
if (!manifest.getMainAttributes().containsValue(Name.MANIFEST_VERSION))
manifest.getMainAttributes().put(Name.MANIFEST_VERSION, "1.0");
}
内容来源于网络,如有侵权,请联系作者删除!