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 - IIFE: var vs this - is there any difference? -

r - Grow a ffdf data frame on disk gradually -