/** * Locate a resource on the class path. * * @param path Path of the reosurce * @return A resource or <code>null</code> */ public Resource findResource(String path) { for (Jar entry : getClasspath()) { Resource r = entry.getResource(path); if (r != null) return r; } return null; }
/** * Locate a resource on the class path. * * @param path Path of the reosurce * @return A resource or <code>null</code> */ public Resource findResource(String path) { for (Jar entry : getClasspath()) { Resource r = entry.getResource(path); if (r != null) return r; } return null; }
/** * Locate a resource on the class path. * * @param path * Path of the reosurce * @return A resource or <code>null</code> */ public Resource findResource(String path) { for (Jar entry : getClasspath()) { Resource r = entry.getResource(path); if (r != null) return r; } return null; }
/** * Locate a resource on the class path. * * @param path * Path of the reosurce * @return A resource or <code>null</code> */ public Resource findResource(String path) { for (Jar entry : getClasspath()) { Resource r = entry.getResource(path); if (r != null) return r; } return null; }
/** * Locate a resource on the class path. * * @param path * Path of the reosurce * @return A resource or <code>null</code> */ public Resource findResource(String path) { for (Jar entry : getClasspath()) { Resource r = entry.getResource(path); if (r != null) return r; } return null; }
public List<Jar> getJarsFromName(String name, String from) { Jar j = super.getJarFromName(name, from); if (j != null) return Collections.singletonList(j); Glob g = new Glob(name); List<Jar> result = new ArrayList<>(); for (Iterator<Jar> cp = getClasspath().iterator(); cp.hasNext();) { Jar entry = cp.next(); if (entry.getSource() == null) continue; if (g.matcher(entry.getSource() .getName()) .matches()) { result.add(entry); } } return result; }
/** * Try to get a Jar from a file name/path or a url, or in last resort from * the classpath name part of their files. * * @param name * URL or filename relative to the base * @param from * Message identifying the caller for errors * @return null or a Jar with the contents for the name */ public Jar getJarFromName(String name, String from) { Jar j = super.getJarFromName(name, from); if (j == null) { for (Iterator<Jar> cp = getClasspath().iterator(); cp.hasNext();) { Jar entry = cp.next(); if (entry.getSource() != null && entry.getSource().getName().equals(name)) { return entry; } } } return j; }
out.printf("Current directory : %s%n", new File("").getAbsolutePath()); out.println("Classpath used"); for (Jar jar : getClasspath()) { out.printf("File : %s%n", jar.getSource()); out.printf("File abs path : %s%n", jar.getSource()
/** * Try to get a Jar from a file name/path or a url, or in last resort from * the classpath name part of their files. * * @param name * URL or filename relative to the base * @param from * Message identifying the caller for errors * @return null or a Jar with the contents for the name */ public Jar getJarFromName(String name, String from) { Jar j = super.getJarFromName(name, from); if (j == null) { for (Iterator<Jar> cp = getClasspath().iterator(); cp.hasNext();) { Jar entry = cp.next(); if (entry.getSource() != null && entry.getSource().getName().equals(name)) { return entry; } } } return j; }
public List<Jar> getJarsFromName(String name, String from) { Jar j = super.getJarFromName(name, from); if (j != null) return Collections.singletonList(j); Glob g = new Glob(name); List<Jar> result = new ArrayList<>(); for (Iterator<Jar> cp = getClasspath().iterator(); cp.hasNext();) { Jar entry = cp.next(); if (entry.getSource() == null) continue; if (g.matcher(entry.getSource() .getName()) .matches()) { result.add(entry); } } return result; }
out.printf("Current directory : %s%n", new File("").getAbsolutePath()); out.println("Classpath used"); for (Jar jar : getClasspath()) { out.printf("File : %s%n", jar.getSource()); out.printf("File abs path : %s%n", jar.getSource().getAbsolutePath());
out.printf("Current directory : %s%n", new File("").getAbsolutePath()); out.println("Classpath used"); for (Jar jar : getClasspath()) { out.printf("File : %s%n", jar.getSource()); out.printf("File abs path : %s%n", jar.getSource()
out.printf("Current directory : %s%n", new File("").getAbsolutePath()); out.println("Classpath used"); for (Jar jar : getClasspath()) { out.printf("File : %s%n", jar.getSource()); out.printf("File abs path : %s%n", jar.getSource().getAbsolutePath());
out.printf("Current directory : %s%n", new File("").getAbsolutePath()); out.println("Classpath used"); for (Jar jar : getClasspath()) { out.printf("File : %s%n", jar.getSource()); out.printf("File abs path : %s%n", jar.getSource().getAbsolutePath());
/** * Try to get a Jar from a file name/path or a url, or in last resort from * the classpath name part of their files. * * @param name URL or filename relative to the base * @param from Message identifying the caller for errors * @return null or a Jar with the contents for the name */ @Override public Jar getJarFromName(String name, String from) { Jar j = super.getJarFromName(name, from); Glob g = new Glob(name); if (j == null) { for (Iterator<Jar> cp = getClasspath().iterator(); cp.hasNext();) { Jar entry = cp.next(); if (entry.getSource() == null) continue; if (g.matcher(entry.getSource() .getName()) .matches()) { return entry; } } } return j; }
/** * Try to get a Jar from a file name/path or a url, or in last resort from * the classpath name part of their files. * * @param name URL or filename relative to the base * @param from Message identifying the caller for errors * @return null or a Jar with the contents for the name */ @Override public Jar getJarFromName(String name, String from) { Jar j = super.getJarFromName(name, from); Glob g = new Glob(name); if (j == null) { for (Iterator<Jar> cp = getClasspath().iterator(); cp.hasNext();) { Jar entry = cp.next(); if (entry.getSource() == null) continue; if (g.matcher(entry.getSource() .getName()) .matches()) { return entry; } } } return j; }
for (Iterator<Jar> cp = getClasspath().iterator(); cp.hasNext();) { Jar entry = cp.next(); if (entry.getSource() != null && entry.getSource().getName().equals(name)) {
private String getRange(Analyzer analyzer) throws Exception { if (foundRange != null) { return foundRange; } if (Strings.isNullOrEmpty(value)) { for (Jar jar : analyzer.getClasspath()) { if (isProvidedByJar(jar) && jar.getVersion() != null) { foundRange = jar.getVersion(); return jar.getVersion(); } } // Cannot find a provider. reporter.error("Cannot find a dependency providing " + name + " in the classpath"); return null; } else { return value; } }
for (Jar jar : getClasspath()) try { if (bsn.equals(jar.getBsn())) {
for (Jar jar : getClasspath()) try { if (bsn.equals(jar.getBsn())) {