aQute.bnd.osgi.Jar.writeEntry()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(85)

本文整理了Java中aQute.bnd.osgi.Jar.writeEntry()方法的一些代码示例,展示了Jar.writeEntry()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jar.writeEntry()方法的具体详情如下:
包路径:aQute.bnd.osgi.Jar
类名称:Jar
方法名:writeEntry

Jar.writeEntry介绍

[英]Write out an entry, handling proper unicode and line length constraints
[中]写出一个条目,处理适当的unicode和行长度约束

代码示例

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

/**
 * Output an Attributes map. We will sort this map before outputing.
 * 
 * @param value the attrbutes
 * @param out the output stream
 * @throws IOException when something fails
 */
private static void attributes(Attributes value, OutputStream out) throws IOException {
  TreeMap<String, String> map = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
  for (Map.Entry<Object, Object> entry : value.entrySet()) {
    map.put(entry.getKey()
      .toString(),
      entry.getValue()
        .toString());
  }
  map.remove("Manifest-Version"); // get rid of manifest version
  for (Map.Entry<String, String> entry : map.entrySet()) {
    writeEntry(out, entry.getKey(), entry.getValue());
  }
}

代码示例来源:origin: biz.aQute/bndlib

/**
 * Output an Attributes map. We will sort this map before outputing.
 * 
 * @param value
 *            the attrbutes
 * @param out
 *            the output stream
 * @throws IOException
 *             when something fails
 */
private static void attributes(Attributes value, OutputStream out) throws IOException {
  TreeMap<String,String> map = new TreeMap<String,String>(String.CASE_INSENSITIVE_ORDER);
  for (Map.Entry<Object,Object> entry : value.entrySet()) {
    map.put(entry.getKey().toString(), entry.getValue().toString());
  }
  map.remove("Manifest-Version"); // get rid of
  // manifest
  // version
  for (Map.Entry<String,String> entry : map.entrySet()) {
    writeEntry(out, entry.getKey(), entry.getValue());
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

/**
 * Output an Attributes map. We will sort this map before outputing.
 * 
 * @param value the attrbutes
 * @param out the output stream
 * @throws IOException when something fails
 */
private static void attributes(Attributes value, OutputStream out) throws IOException {
  TreeMap<String, String> map = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
  for (Map.Entry<Object, Object> entry : value.entrySet()) {
    map.put(entry.getKey()
      .toString(),
      entry.getValue()
        .toString());
  }
  map.remove("Manifest-Version"); // get rid of manifest version
  for (Map.Entry<String, String> entry : map.entrySet()) {
    writeEntry(out, entry.getKey(), entry.getValue());
  }
}

代码示例来源:origin: biz.aQute.bnd/bndlib

/**
 * Output an Attributes map. We will sort this map before outputing.
 * 
 * @param value
 *            the attrbutes
 * @param out
 *            the output stream
 * @throws IOException
 *             when something fails
 */
private static void attributes(Attributes value, OutputStream out) throws IOException {
  TreeMap<String,String> map = new TreeMap<String,String>(String.CASE_INSENSITIVE_ORDER);
  for (Map.Entry<Object,Object> entry : value.entrySet()) {
    map.put(entry.getKey().toString(), entry.getValue().toString());
  }
  map.remove("Manifest-Version"); // get rid of
  // manifest
  // version
  for (Map.Entry<String,String> entry : map.entrySet()) {
    writeEntry(out, entry.getKey(), entry.getValue());
  }
}

代码示例来源:origin: biz.aQute.bnd/bnd

/**
 * Output an Attributes map. We will sort this map before outputing.
 * 
 * @param value
 *            the attrbutes
 * @param out
 *            the output stream
 * @throws IOException
 *             when something fails
 */
private static void attributes(Attributes value, OutputStream out) throws IOException {
  TreeMap<String,String> map = new TreeMap<String,String>(String.CASE_INSENSITIVE_ORDER);
  for (Map.Entry<Object,Object> entry : value.entrySet()) {
    map.put(entry.getKey().toString(), entry.getValue().toString());
  }
  map.remove("Manifest-Version"); // get rid of
  // manifest
  // version
  for (Map.Entry<String,String> entry : map.entrySet()) {
    writeEntry(out, entry.getKey(), entry.getValue());
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

/**
 * Main function to output a manifest properly in UTF-8.
 * 
 * @param manifest The manifest to output
 * @param out The output stream
 * @throws IOException when something fails
 */
public static void outputManifest(Manifest manifest, OutputStream out) throws IOException {
  writeEntry(out, "Manifest-Version", "1.0");
  attributes(manifest.getMainAttributes(), out);
  out.write(EOL);
  TreeSet<String> keys = new TreeSet<>();
  for (Object o : manifest.getEntries()
    .keySet())
    keys.add(o.toString());
  for (String key : keys) {
    writeEntry(out, "Name", key);
    attributes(manifest.getAttributes(key), out);
    out.write(EOL);
  }
  out.flush();
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

/**
 * Main function to output a manifest properly in UTF-8.
 * 
 * @param manifest The manifest to output
 * @param out The output stream
 * @throws IOException when something fails
 */
public static void outputManifest(Manifest manifest, OutputStream out) throws IOException {
  writeEntry(out, "Manifest-Version", "1.0");
  attributes(manifest.getMainAttributes(), out);
  out.write(EOL);
  TreeSet<String> keys = new TreeSet<>();
  for (Object o : manifest.getEntries()
    .keySet())
    keys.add(o.toString());
  for (String key : keys) {
    writeEntry(out, "Name", key);
    attributes(manifest.getAttributes(key), out);
    out.write(EOL);
  }
  out.flush();
}

代码示例来源:origin: biz.aQute.bnd/bnd

/**
 * Main function to output a manifest properly in UTF-8.
 * 
 * @param manifest
 *            The manifest to output
 * @param out
 *            The output stream
 * @throws IOException
 *             when something fails
 */
public static void outputManifest(Manifest manifest, OutputStream out) throws IOException {
  writeEntry(out, "Manifest-Version", "1.0");
  attributes(manifest.getMainAttributes(), out);
  TreeSet<String> keys = new TreeSet<String>();
  for (Object o : manifest.getEntries().keySet())
    keys.add(o.toString());
  for (String key : keys) {
    write(out, 0, "\r\n");
    writeEntry(out, "Name", key);
    attributes(manifest.getAttributes(key), out);
  }
  out.flush();
}

代码示例来源:origin: biz.aQute/bndlib

/**
 * Main function to output a manifest properly in UTF-8.
 * 
 * @param manifest
 *            The manifest to output
 * @param out
 *            The output stream
 * @throws IOException
 *             when something fails
 */
public static void outputManifest(Manifest manifest, OutputStream out) throws IOException {
  writeEntry(out, "Manifest-Version", "1.0");
  attributes(manifest.getMainAttributes(), out);
  TreeSet<String> keys = new TreeSet<String>();
  for (Object o : manifest.getEntries().keySet())
    keys.add(o.toString());
  for (String key : keys) {
    write(out, 0, "\r\n");
    writeEntry(out, "Name", key);
    attributes(manifest.getAttributes(key), out);
  }
  out.flush();
}

代码示例来源:origin: biz.aQute.bnd/bndlib

/**
 * Main function to output a manifest properly in UTF-8.
 * 
 * @param manifest
 *            The manifest to output
 * @param out
 *            The output stream
 * @throws IOException
 *             when something fails
 */
public static void outputManifest(Manifest manifest, OutputStream out) throws IOException {
  writeEntry(out, "Manifest-Version", "1.0");
  attributes(manifest.getMainAttributes(), out);
  TreeSet<String> keys = new TreeSet<String>();
  for (Object o : manifest.getEntries().keySet())
    keys.add(o.toString());
  for (String key : keys) {
    write(out, 0, "\r\n");
    writeEntry(out, "Name", key);
    attributes(manifest.getAttributes(key), out);
  }
  out.flush();
}

相关文章

微信公众号

最新文章

更多