本文整理了Java中java.util.jar.Manifest.read()
方法的一些代码示例,展示了Manifest.read()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Manifest.read()
方法的具体详情如下:
包路径:java.util.jar.Manifest
类名称:Manifest
方法名:read
[英]Merges name/attribute pairs read from the input stream is into this manifest.
[中]将从输入流读取的名称/属性对合并到此清单中。
代码示例来源:origin: robovm/robovm
/**
* Creates a new {@code Manifest} instance using the attributes obtained
* from the input stream.
*
* @param is
* {@code InputStream} to parse for attributes.
* @throws IOException
* if an IO error occurs while creating this {@code Manifest}
*/
public Manifest(InputStream is) throws IOException {
read(is);
}
代码示例来源:origin: robovm/robovm
Manifest(InputStream is, boolean readChunks) throws IOException {
if (readChunks) {
chunks = new HashMap<String, Chunk>();
}
read(is);
}
代码示例来源:origin: google/guava
private static Manifest manifest(String content) throws IOException {
InputStream in = new ByteArrayInputStream(content.getBytes(US_ASCII));
Manifest manifest = new Manifest();
manifest.read(in);
return manifest;
}
代码示例来源:origin: aol/micro-server
public Map<String, String> getManifest(final InputStream input) {
final Map<String, String> retMap = new HashMap<String, String>();
try {
Manifest manifest = new Manifest();
manifest.read(input);
final Attributes attributes = manifest.getMainAttributes();
for (final Map.Entry attribute : attributes.entrySet()) {
retMap.put(attribute.getKey().toString(), attribute.getValue().toString());
}
} catch (final Exception ex) {
logger.error( "Failed to load manifest ", ex);
}
return retMap;
}
代码示例来源:origin: aol/micro-server
public Map<String, String> getManifest(final InputStream input) {
final Map<String, String> retMap = new HashMap<String, String>();
try {
Manifest manifest = new Manifest();
manifest.read(input);
final Attributes attributes = manifest.getMainAttributes();
for (final Map.Entry attribute : attributes.entrySet()) {
retMap.put(attribute.getKey().toString(), attribute.getValue().toString());
}
} catch (final Exception ex) {
logger.error("Failed to load manifest ", ex);
}
return retMap;
}
}
代码示例来源:origin: testcontainers/testcontainers-java
try (InputStream is = manifestURL.openStream()) {
Manifest manifest = new Manifest();
manifest.read(is);
代码示例来源:origin: testcontainers/testcontainers-java
/**
* Check if Selenium Version detected is the correct one.
* @param urlManifest : manifest file
* @throws IOException
*/
private void checkSeleniumVersionDetected(String urlManifest, String expectedVersion) throws IOException {
Manifest manifest = new Manifest();
manifest.read(this.getClass().getClassLoader().getResourceAsStream(urlManifest));
String seleniumVersion = SeleniumUtils.getSeleniumVersionFromManifest(manifest);
assertEquals("Check if Selenium Version detected is the correct one.", expectedVersion, seleniumVersion);
}
代码示例来源:origin: geotools/geotools
try {
try (InputStream content = manifestLocation.openStream()) {
manifest.read(content);
manifest.read(new ByteArrayInputStream(generated.getBytes()));
} catch (IOException e) {
代码示例来源:origin: geotools/geotools
Manifest manifest = new Manifest();
try (InputStream content = manifestLocation.openStream()) {
manifest.read(content);
代码示例来源:origin: MobiVM/robovm
/**
* Creates a new {@code Manifest} instance using the attributes obtained
* from the input stream.
*
* @param is
* {@code InputStream} to parse for attributes.
* @throws IOException
* if an IO error occurs while creating this {@code Manifest}
*/
public Manifest(InputStream is) throws IOException {
read(is);
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
/**
* Creates a new {@code Manifest} instance using the attributes obtained
* from the input stream.
*
* @param is
* {@code InputStream} to parse for attributes.
* @throws IOException
* if an IO error occurs while creating this {@code Manifest}
*/
public Manifest(InputStream is) throws IOException {
read(is);
}
代码示例来源:origin: com.jtransc/jtransc-rt
/**
* Creates a new {@code Manifest} instance using the attributes obtained
* from the input stream.
*
* @param is
* {@code InputStream} to parse for attributes.
* @throws IOException
* if an IO error occurs while creating this {@code Manifest}
*/
public Manifest(InputStream is) throws IOException {
read(is);
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
Manifest(InputStream is, boolean readChunks) throws IOException {
if (readChunks) {
chunks = new HashMap<String, Chunk>();
}
read(is);
}
代码示例来源:origin: com.gluonhq/robovm-rt
Manifest(InputStream is, boolean readChunks) throws IOException {
if (readChunks) {
chunks = new HashMap<String, Chunk>();
}
read(is);
}
代码示例来源:origin: de.smartics.deploy/deployment-metadata
/**
* {@inheritDoc}
*/
@Override
protected Manifest readResource(final InputStream in) throws IOException
{
final Manifest manifest = new Manifest();
manifest.read(in);
return manifest;
}
代码示例来源:origin: MobiVM/robovm
Manifest(InputStream is, boolean readChunks) throws IOException {
if (readChunks) {
chunks = new HashMap<String, Chunk>();
}
read(is);
}
代码示例来源:origin: stackoverflow.com
public String getMavenVersion(ServletContext ctx) {
String appServerHome = ctx.getRealPath("/");
File manifestFile = new File(appServerHome, "META-INF/MANIFEST.MF");
Manifest mf = new Manifest();
mf.read(new FileInputStream(manifestFile));
Attributes atts = mf.getMainAttributes();
return atts.getValue("Implementation-Build");
}
代码示例来源:origin: com.opentable.components/otj-server-core
private void readManifest(final URL url) throws IOException {
try (InputStream is = url.openStream()) {
final Manifest mf = new Manifest();
mf.read(is);
final Attributes atts = mf.getMainAttributes();
LOG.debug("Starting up: {} version {} - built from commit {}",
atts.getValue(Attributes.Name.IMPLEMENTATION_TITLE),
atts.getValue(Attributes.Name.IMPLEMENTATION_VERSION),
atts.getValue(COMMIT)
);
}
}
代码示例来源:origin: org.patterntesting/patterntesting-rt
private static Manifest getManifest(final URI uri) throws IOException {
String content = IOUtils.toString(uri, StandardCharsets.UTF_8);
InputStream istream = new ByteArrayInputStream(content.getBytes("UTF8"));
try {
Manifest manifest = new Manifest(istream);
manifest.read(istream);
manifest.getMainAttributes().putValue(MANIFEST_URI, uri.toString());
return manifest;
} finally {
istream.close();
}
}
代码示例来源:origin: org.glassfish.common/common-util
public AdminCommandResponse(InputStream inStream) throws IOException {
Manifest m = new Manifest(inStream);
m.read(inStream);
allRaw = ManifestUtils.normalize(m);
mainRaw = ManifestUtils.getMain(allRaw);
makeMain();
}
内容来源于网络,如有侵权,请联系作者删除!