Code example for Path

Methods: getFileNametoUri

    private static void addClassPath(File classpath, final List<URL> urls) throws IOException {
        Files.walkFileTree(classpath.toPath(), new SimpleFileVisitor<Path>(){
            public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
                String name = file.getFileName().toString();
                if(name.endsWith(".jar") || name.endsWith(".car")){
                return FileVisitResult.CONTINUE;
    public static void main(String[] args) throws Exception {
        File systemClasspath = new File(SystemRepo);
        File libClasspath = new File(FlatRepoLib);
        List<URL> urls = new LinkedList<URL>();
Connect your IDE to all the code out there  Get Codota for Java