public class NioFileLocker extends AbstractFileLockerFilter
FileReadingMessageSources sharing a Locker will not pick up the same files.
This implementation will acquire or create a
FileLock for the given file. Caching locks might be expensive,
so this locking strategy is not recommended for scenarios where many files are accessed in parallel.
|Constructor and Description|
|Modifier and Type||Method and Description|
Checks whether the file passed in can be locked by this locker.
Tries to lock the given file and returns
Unlocks the given file.
public boolean lock(File fileToLock)
trueif it was successful,
fileToLock- the file that should be locked according to this locker
public boolean isLockable(File file)
file- The file.