Considering the scenario where 'file' is a symbolic link to a real one
file -> real_file
if I configure PropertiesConfiguration
(from Apache Commons Config) to open the symbolic link it doens't reload it if I update the real file
String filePath = new File(path).getCanonicalPath();
PropertiesConfiguration configuration = new PropertiesConfiguration(new File(filePath));
configuration.setReloadingStrategy(new FileChangedReloadingStrategy());
Of course, in this case the update date of the symbolic link is unchanged, unlike the real one.
Is there a way to force PropertiesConfiguration
to follow symbolic link and recognize changes on real file?
The problem is that
.getCanonicalPath()
open the pointed file and not the symblink. If someone replace the real file with another onePropertiecConfiguration
is still pointing to an not existing file, so the reload doens't work