private void resetWatchKey(WatchEntity entity, WatchKey key, Path contextPath) {
        key.reset();
        /*
         * Register a new watch service on the path if the old watcher is invalid.
         */
        if (!key.isValid()) {
            LOGGER.warn("Invalid Watcher {}", contextPath.getFileName());
            try {
                WatchService oldService = entity.getWatchService();
                oldService.close();
                WatchService watchService = FileSystems.getDefault().newWatchService();
                entity.clearKeys();
                entity.clearPathToKeys();
                entity.setWatchService(watchService);
                entity.registerRecursively();
            } catch (IOException e) {
                LOGGER.error("Restart a new watcher runs into error: ", e);
            }
        }
    }
Replace any non-numeric characters in the file time
such as 2015-09-16_00 replace with 2015091600
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/task/logcollection/local/FileTask.java