static void buildClasspath()

in src/main/java/org/apache/maven/plugins/pmd/exec/Executor.java [69:82]


    static void buildClasspath(StringBuilder classpath, ClassLoader cl) {
        if (cl instanceof URLClassLoader) {
            for (URL url : ((URLClassLoader) cl).getURLs()) {
                if ("file".equalsIgnoreCase(url.getProtocol())) {
                    try {
                        String filename = URLDecoder.decode(url.getPath(), StandardCharsets.UTF_8.name());
                        classpath.append(new File(filename).getPath()).append(File.pathSeparatorChar);
                    } catch (UnsupportedEncodingException e) {
                        LOG.warn("Ignoring " + url + " in classpath due to UnsupportedEncodingException", e);
                    }
                }
            }
        }
    }