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

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

本文整理了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

private static Jar openJar( final File file )
  throws MojoExecutionException
{
  try
  {
    return new Jar( file );
  }
  catch ( final IOException e )
  {
    throw new MojoExecutionException( "An error occurred while opening JAR directory: " + file, e );
  }
}

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

public Jar doSource() throws IOException {
  if (!hasSources())
    return new Jar("sources");
  return new Jar(sources);
}

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

public Jar doSource() throws IOException {
  if (!hasSources())
    return new Jar("sources");
  return new Jar(sources);
}

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

/**
 * @see aQute.bnd.service.diff.Differ#tree(aQute.bnd.osgi.Jar)
 */
public Tree tree(File newer) throws Exception {
  try (Jar jnewer = new Jar(newer)) {
    return tree(jnewer);
  }
}

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

/**
 * Set the JAR file we are going to work in. This will read the JAR in
 * memory.
 * 
 * @param file
 * @throws IOException
 */
public Jar setJar(File file) throws IOException {
  Jar jar = new Jar(file);
  setJar(jar);
  return jar;
}

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

public Jar getValidJar(URL url) throws Exception {
  InputStream in = url.openStream();
  try {
    Jar jar = new Jar(url.getFile().replace('/', '.'), in, System.currentTimeMillis());
    return getValidJar(jar, url.toString());
  }
  finally {
    in.close();
  }
}

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

/**
 * Set the JAR file we are going to work in. This will read the JAR in
 * memory.
 * 
 * @param file
 * @throws IOException
 */
public Jar setJar(File file) throws IOException {
  Jar jar = new Jar(file);
  setJar(jar);
  return jar;
}

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

private Jar toJar(Processor context, String path) throws Exception {
  if (path == null)
    return null;
  File f = context.getFile(path);
  if (f.exists())
    return new Jar(f);
  return null;
}

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

public Jar getValidJar(URL url) throws Exception {
  InputStream in = url.openStream();
  try {
    Jar jar = new Jar(url.getFile().replace('/', '.'), in, System.currentTimeMillis());
    return getValidJar(jar, url.toString());
  }
  finally {
    in.close();
  }
}

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

@SuppressWarnings("resource")
public static Jar fromResource(String name, Resource resource) throws Exception {
  if (resource instanceof JarResource) {
    return ((JarResource) resource).getJar();
  } else if (resource instanceof FileResource) {
    return new Jar(name, ((FileResource) resource).getFile());
  }
  return new Jar(name).buildFromResource(resource);
}

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

@SuppressWarnings("resource")
public static Jar fromResource(String name, Resource resource) throws Exception {
  if (resource instanceof JarResource) {
    return ((JarResource) resource).getJar();
  } else if (resource instanceof FileResource) {
    return new Jar(name, ((FileResource) resource).getFile());
  }
  return new Jar(name).buildFromResource(resource);
}

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

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

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

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

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

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

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

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

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

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

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

public void addClasspath(Container c) throws IOException {
  File file = c.getFile();
  if ((c.getType() == TYPE.PROJECT) && !file.exists()) {
    return;
  }
  Jar jar = new Jar(file);
  super.addClasspath(jar);
  project.unreferencedClasspathEntries.put(jar.getName(), c);
}

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

public Jar getLastRevision() throws Exception {
  RepositoryPlugin releaseRepo = getReleaseRepo();
  SortedSet<Version> versions = releaseRepo.versions(getBsn());
  if (versions.isEmpty())
    return null;
  Jar jar = new Jar(releaseRepo.get(getBsn(), versions.last(), null));
  addClose(jar);
  return jar;
}

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

public Jar getLastRevision() throws Exception {
  RepositoryPlugin releaseRepo = getReleaseRepo();
  SortedSet<Version> versions = releaseRepo.versions(getBsn());
  if (versions.isEmpty())
    return null;
  Jar jar = new Jar(releaseRepo.get(getBsn(), versions.last(), null));
  addClose(jar);
  return jar;
}

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

@Override
public Entry<String, Resource> export(String type, Project project, Map<String, String> options) throws Exception {
  project.prepare();
  Collection<Container> runbundles = project.getRunbundles();
  Jar jar = new Jar(project.getName());
  jar.setDoNotTouchManifest();
  for (Container container : runbundles) {
    File source = container.getFile();
    String path = nonCollidingPath(jar, source.getName());
    jar.putResource(path, new FileResource(source));
  }
  return new SimpleEntry<>(jar.getName(), new JarResource(jar, true));
}

相关文章

微信公众号

最新文章

更多