• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

ClassLoader and directories

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anyone know how to load all of the files inside a directory that is inside a war or jar? I have been using the ClassLoader to load config files which works great if you know the name of the file.
URL url = this.getClass().getClassLoader().getResource("config/manufacturerDataImport/import1.xml");
However I would like to be able to load all of the files inside the directory, and have the names be able to change. So If I had a URL that is
URL url = this.getClass().getClassLoader().getResource("config/manufacturerDataImport/");
I want to get a Collection of all of the xml files inside that URL directory.
Thanks,
-John
 
reply
    Bookmark Topic Watch Topic
  • New Topic