/** * 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); }
Manifest(InputStream is, boolean readChunks) throws IOException { if (readChunks) { chunks = new HashMap<String, Chunk>(); } read(is); }
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; }
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; }
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; } }
try (InputStream is = manifestURL.openStream()) { Manifest manifest = new Manifest(); manifest.read(is);
/** * 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); }
Manifest manifest = new Manifest(); try (InputStream content = manifestLocation.openStream()) { manifest.read(content);
/** * 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); }
/** * 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); }
/** * 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); }
Manifest(InputStream is, boolean readChunks) throws IOException { if (readChunks) { chunks = new HashMap<String, Chunk>(); } read(is); }
Manifest(InputStream is, boolean readChunks) throws IOException { if (readChunks) { chunks = new HashMap<String, Chunk>(); } read(is); }
/** * {@inheritDoc} */ @Override protected Manifest readResource(final InputStream in) throws IOException { final Manifest manifest = new Manifest(); manifest.read(in); return manifest; }
Manifest(InputStream is, boolean readChunks) throws IOException { if (readChunks) { chunks = new HashMap<String, Chunk>(); } read(is); }
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"); }
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) ); } }
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(); } }
public AdminCommandResponse(InputStream inStream) throws IOException { Manifest m = new Manifest(inStream); m.read(inStream); allRaw = ManifestUtils.normalize(m); mainRaw = ManifestUtils.getMain(allRaw); makeMain(); }