com.strobel.assembler.metadata.JarTypeLoader Java Examples
The following examples show how to use
com.strobel.assembler.metadata.JarTypeLoader.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HuntBugsMojo.java From huntbugs with Apache License 2.0 | 6 votes |
private void addDependency(Artifact art, List<ITypeLoader> deps) throws IOException { if ("compile".equals(art.getScope())) { ArtifactRepository localRepository = session.getLocalRepository(); File f = localRepository.find(art).getFile(); if (f != null) { Path path = f.toPath(); if (!quiet) { getLog().info("HuntBugs: +dep " + path); } if (Files.isRegularFile(path) && art.getType().equals("jar")) { deps.add(new JarTypeLoader(new JarFile(path.toFile()))); } else if (Files.isDirectory(path)) { deps.add(new ClasspathTypeLoader(path.toString())); } } } }
Example #2
Source File: HuntBugs.java From huntbugs with Apache License 2.0 | 5 votes |
private ITypeLoader createTypeLoader(Path path) { try { return Files.isDirectory(path) ? new ClasspathTypeLoader(path.toString()) : new JarTypeLoader(new JarFile(path.toFile())); } catch (IOException e) { throw new UncheckedIOException(e); } }
Example #3
Source File: JarRepository.java From huntbugs with Apache License 2.0 | 4 votes |
@Override public ITypeLoader createTypeLoader() { return new JarTypeLoader(file); }