Here you can find the source of lockFileExists(File file)
public static boolean lockFileExists(File file)
//package com.java2s; //License from project: Apache License import java.io.File; import java.nio.file.Files; import java.nio.file.Path; public class Main { public static boolean lockFileExists(File file) { Path lockFilePath = getLockFilePath(file); return Files.exists(lockFilePath); }//from w w w . j ava2 s . co m public static Path getLockFilePath(File file) { String lockFileName = file.getName() + ".lock"; Path fileDirectory = file.toPath().toAbsolutePath().normalize().getParent(); return fileDirectory.resolve(lockFileName); } }