| | |
| | | private final ExecutorService executor = Executors.newCachedThreadPool(); |
| | | private final Map<Path, WatchService> watchServices = new HashMap<>(); |
| | | private final Map<Path, FileChangeListener> listeners = new HashMap<>(); |
| | | private final Map<Path, FileState> fileStatesOld = new HashMap<>(); |
| | | |
| | | Cache<Path, FileState> fileStates = CacheBuilder.newBuilder() |
| | | .maximumSize(10) // 最大容量3 |
| | | .build(); |
| | |
| | | |
| | | FileState currentState = fileStates.getIfPresent(fullPath); |
| | | currentState = (currentState == null) ? FileState.STABLE : currentState; |
| | | |
| | | //FileState currentState = fileStates.getOrDefault(fullPath, FileState.STABLE); |
| | | |
| | | FileChangeListener currentListener = listeners.get(directory); |
| | | if (currentListener == null) break; |