java - Getting a List of files from a class path entry -


i facing problem in application cannot list resource class path entry.

enumeration<url> resources = thread.currentthread().getcontextclassloader().getresources("src/main/resources/*.*"); system.out.println(resources); while (resources.hasmoreelements()) {   url url = resources.nextelement();   //here getting empty url list.please help.   system.out.println(url); } 

the couple of problems:

  1. src/main/resources/*.* not valid syntax classloader.getresources()
    • the path must full path, e.g. src/main/resources
  2. why trying load classes src/main/resources directory?
    • it assumes resources in such directory, work development purposes
    • after compilation resources stored in different directory (maven put top level directory default) , program not work correctly

Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -