Java FileLock lockFileExists(File file)

Here you can find the source of lockFileExists(File file)

Description

lock File Exists

License

Apache License

Declaration

public static boolean lockFileExists(File file) 

Method Source Code


//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);
    }
}

Related

  1. isLocked(File file)
  2. isLocked(File file)
  3. lock(File file)
  4. lockFile(File file)
  5. lockFile(File file, RandomAccessFile raf)
  6. openTcpSocket(boolean blocking)
  7. pauseForLock(File f, int frequency, int totalTime)
  8. releaseQuietly(FileLock lock)
  9. releaseQuietly(final FileLock lock)