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

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

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

Jar.<init>介绍

暂无

代码示例

代码示例来源:origin: org.apache.felix/maven-bundle-plugin

  1. private static Jar openJar( final File file )
  2. throws MojoExecutionException
  3. {
  4. try
  5. {
  6. return new Jar( file );
  7. }
  8. catch ( final IOException e )
  9. {
  10. throw new MojoExecutionException( "An error occurred while opening JAR directory: " + file, e );
  11. }
  12. }

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

  1. public Jar doSource() throws IOException {
  2. if (!hasSources())
  3. return new Jar("sources");
  4. return new Jar(sources);
  5. }

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

  1. public Jar doSource() throws IOException {
  2. if (!hasSources())
  3. return new Jar("sources");
  4. return new Jar(sources);
  5. }

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

  1. /**
  2. * @see aQute.bnd.service.diff.Differ#tree(aQute.bnd.osgi.Jar)
  3. */
  4. public Tree tree(File newer) throws Exception {
  5. try (Jar jnewer = new Jar(newer)) {
  6. return tree(jnewer);
  7. }
  8. }

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

  1. /**
  2. * Set the JAR file we are going to work in. This will read the JAR in
  3. * memory.
  4. *
  5. * @param file
  6. * @throws IOException
  7. */
  8. public Jar setJar(File file) throws IOException {
  9. Jar jar = new Jar(file);
  10. setJar(jar);
  11. return jar;
  12. }

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

  1. public Jar getValidJar(URL url) throws Exception {
  2. InputStream in = url.openStream();
  3. try {
  4. Jar jar = new Jar(url.getFile().replace('/', '.'), in, System.currentTimeMillis());
  5. return getValidJar(jar, url.toString());
  6. }
  7. finally {
  8. in.close();
  9. }
  10. }

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

  1. /**
  2. * Set the JAR file we are going to work in. This will read the JAR in
  3. * memory.
  4. *
  5. * @param file
  6. * @throws IOException
  7. */
  8. public Jar setJar(File file) throws IOException {
  9. Jar jar = new Jar(file);
  10. setJar(jar);
  11. return jar;
  12. }

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

  1. private Jar toJar(Processor context, String path) throws Exception {
  2. if (path == null)
  3. return null;
  4. File f = context.getFile(path);
  5. if (f.exists())
  6. return new Jar(f);
  7. return null;
  8. }

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

  1. public Jar getValidJar(URL url) throws Exception {
  2. InputStream in = url.openStream();
  3. try {
  4. Jar jar = new Jar(url.getFile().replace('/', '.'), in, System.currentTimeMillis());
  5. return getValidJar(jar, url.toString());
  6. }
  7. finally {
  8. in.close();
  9. }
  10. }

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

  1. @SuppressWarnings("resource")
  2. public static Jar fromResource(String name, Resource resource) throws Exception {
  3. if (resource instanceof JarResource) {
  4. return ((JarResource) resource).getJar();
  5. } else if (resource instanceof FileResource) {
  6. return new Jar(name, ((FileResource) resource).getFile());
  7. }
  8. return new Jar(name).buildFromResource(resource);
  9. }

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

  1. @SuppressWarnings("resource")
  2. public static Jar fromResource(String name, Resource resource) throws Exception {
  3. if (resource instanceof JarResource) {
  4. return ((JarResource) resource).getJar();
  5. } else if (resource instanceof FileResource) {
  6. return new Jar(name, ((FileResource) resource).getFile());
  7. }
  8. return new Jar(name).buildFromResource(resource);
  9. }

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

  1. public void addClasspath(File cp) throws IOException {
  2. if (!cp.exists())
  3. warning("File on classpath that does not exist: " + cp);
  4. Jar jar = new Jar(cp);
  5. addClose(jar);
  6. classpath.add(jar);
  7. }

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

  1. public void addClasspath(File cp) throws IOException {
  2. if (!cp.exists())
  3. warning("File on classpath that does not exist: %s", cp);
  4. Jar jar = new Jar(cp);
  5. addClasspath(jar);
  6. }

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

  1. public void addClasspath(File cp) throws IOException {
  2. if (!cp.exists())
  3. warning("File on classpath that does not exist: %s", cp);
  4. Jar jar = new Jar(cp);
  5. addClasspath(jar);
  6. }

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

  1. /**
  2. * This methods attempts to turn any jar into a valid jar. If this is a
  3. * bundle with manifest, a manifest is added based on defaults. If it is a
  4. * bundle, but not r4, we try to add the r4 headers.
  5. *
  6. * @throws Exception
  7. */
  8. public Jar getValidJar(File f) throws Exception {
  9. Jar jar = new Jar(f);
  10. return getValidJar(jar, IO.absolutePath(f));
  11. }

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

  1. /**
  2. * This methods attempts to turn any jar into a valid jar. If this is a
  3. * bundle with manifest, a manifest is added based on defaults. If it is a
  4. * bundle, but not r4, we try to add the r4 headers.
  5. *
  6. * @throws Exception
  7. */
  8. public Jar getValidJar(File f) throws Exception {
  9. Jar jar = new Jar(f);
  10. return getValidJar(jar, IO.absolutePath(f));
  11. }

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

  1. public void addClasspath(Container c) throws IOException {
  2. File file = c.getFile();
  3. if ((c.getType() == TYPE.PROJECT) && !file.exists()) {
  4. return;
  5. }
  6. Jar jar = new Jar(file);
  7. super.addClasspath(jar);
  8. project.unreferencedClasspathEntries.put(jar.getName(), c);
  9. }

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

  1. public Jar getLastRevision() throws Exception {
  2. RepositoryPlugin releaseRepo = getReleaseRepo();
  3. SortedSet<Version> versions = releaseRepo.versions(getBsn());
  4. if (versions.isEmpty())
  5. return null;
  6. Jar jar = new Jar(releaseRepo.get(getBsn(), versions.last(), null));
  7. addClose(jar);
  8. return jar;
  9. }

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

  1. public Jar getLastRevision() throws Exception {
  2. RepositoryPlugin releaseRepo = getReleaseRepo();
  3. SortedSet<Version> versions = releaseRepo.versions(getBsn());
  4. if (versions.isEmpty())
  5. return null;
  6. Jar jar = new Jar(releaseRepo.get(getBsn(), versions.last(), null));
  7. addClose(jar);
  8. return jar;
  9. }

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

  1. @Override
  2. public Entry<String, Resource> export(String type, Project project, Map<String, String> options) throws Exception {
  3. project.prepare();
  4. Collection<Container> runbundles = project.getRunbundles();
  5. Jar jar = new Jar(project.getName());
  6. jar.setDoNotTouchManifest();
  7. for (Container container : runbundles) {
  8. File source = container.getFile();
  9. String path = nonCollidingPath(jar, source.getName());
  10. jar.putResource(path, new FileResource(source));
  11. }
  12. return new SimpleEntry<>(jar.getName(), new JarResource(jar, true));
  13. }

相关文章