Skip to content

Tag: watchservice

Java WatchService locks directory on Windows

It seems when you watch a directory using Java’s WatchService and then try to rename its parent directory, the renaming will fail with an AccessDeniedException. The directory seems to be sort of locked by the WatchService. Can be reproduced with: Fails with: Tested with OpenJDK 11 & 14 on Windows 10…