This article introduces the FileLock class and its basic usage. This article examples show using file locks with FileChannels. The examples in this article are compiled and run in Windows OS environment. Note that Java SE 7 is required to run the code. 1. IntroductionFileLock is a token representing a lock on a region of a file. This is an abstract class defined in the java.nio.channels package. 1