1

I am using the reflections package to scan some files in my classpath. The code below is run at regular intervals. Basically i am retriving all xml files within a folder 'tmp' in the classpath. This code is being run from a web application.

Reflections reflections = new Reflections("tmp", new ResourcesScanner());
Set<String> xmls = reflections.getResources(Pattern.compile(".*\\.xml"));

When i add another xml file in the services folder it gets read. However, when i update any of those xml files, the update is NOT reflected. Is there some kind of caching going on there? If yes, is there anyway to avoid the same?

noi.m
  • 3,070
  • 5
  • 34
  • 57

1 Answers1

1

No, Reflections does not cache resources. It simply scans and creates a Store object - actually a multimap of Strings.

Reading / retrieving the resources on runtime is done based on their names (via Store) and uses the configured classloader (which defaults to the context class loader)

zapp
  • 1,533
  • 1
  • 14
  • 18