Java Path to URL getUrlsFromClassPath(String path)

Here you can find the source of getUrlsFromClassPath(String path)

Description

get Urls From Class Path

License

Open Source License

Declaration

public static List<URL> getUrlsFromClassPath(String path) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;

import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;

public class Main {
    public static List<URL> getUrlsFromClassPath(String path) {
        List<URL> urls = new ArrayList<>();
        try {/*from w  w w  .  ja  va2 s  .  co m*/
            Enumeration<URL> e = ClassLoader.getSystemResources(path);
            while (e.hasMoreElements()) {
                urls.add(e.nextElement());
            }
        } catch (IOException e) {
        }
        return urls;
    }
}

Related

  1. getUrlPath(URL url)
  2. getURLPathFromURI(String uri)
  3. getURLPathFromURN(String urn)
  4. getURLs(List paths)
  5. getURLs(String thePaths[])
  6. getWebDocInfoStr(String urlPath)
  7. getWorkspaceURL(String subpath)
  8. pathAsUrlString(String path)
  9. pathFromURL(final URL url)