Stefano Rocca created CAMEL-24596:
-------------------------------------

             Summary: FileWatcherResourceReloadStrategy should rely exclusively 
on NIO.2
                 Key: CAMEL-24596
                 URL: https://issues.apache.org/jira/browse/CAMEL-24596
             Project: Camel
          Issue Type: Wish
          Components: came-core
    Affects Versions: 4.23.0
            Reporter: Stefano Rocca


We are migrating from camel 3.x to 4.x and I was looking at 
RouteWatcherReloadStrategy hoping to replace our custom route reload 
procedures. Unfortunately at the moment this is impossible because we use a 
custom FileSystem implementation to access routes' XML files and in 
FileWatcherResourceReloadStrategy there's this bit of code that uses the old 
Java I/O


{noformat}
        File dir = new File(folder);
        if (dir.exists() && dir.isDirectory()) {
...
        try {
                Path path = dir.toPath();{noformat}
 
This code expects that the folder is on a standard OS managed file system.
In my opinion "folder" should be a Path from the start. You can also allow the 
user to specify a String (in the Spring Boot scenario with 
application.properties that's mandatory) but you should convert it ASAP to a 
Path. This means that this class (and also RouteWatcherReloadStrategy) should 
accept also a Path parameter.

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to