public class

FileMonitor

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.io.FileMonitor

Summary

Constants
long CHECK_MS
long TOUCH_MS
Public Methods
static FileMonitor create(File file)
Create a monitor object for the provided file.
static FileMonitor create(File folder, String filename, boolean singlefile)
Create a monitor object for the provided file or group of files.
static FileMonitor get(File file)
Retrieve the existing monitor for the provided file.@return
static FileMonitor get(File folder, String filename, boolean singlefile)
Retrieve the existing monitor for the provided file or group of files.@return
boolean isLocked()
void lock()
Create and refresh a valid lock file (per this monitor setting).
void unlock(boolean unregister)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final long CHECK_MS

Constant Value: 3000 (0x0000000000000bb8)

public static final long TOUCH_MS

Constant Value: 1000 (0x00000000000003e8)

Public Methods

public static FileMonitor create (File file)

Create a monitor object for the provided file. (Note that this method does not create any file.)@return

Throws
IOException

public static FileMonitor create (File folder, String filename, boolean singlefile)

Create a monitor object for the provided file or group of files. (Note that this method does not create any file.)@return

Throws
IOException

public static FileMonitor get (File file)

Retrieve the existing monitor for the provided file.@return

Throws
IOException

public static FileMonitor get (File folder, String filename, boolean singlefile)

Retrieve the existing monitor for the provided file or group of files.@return

Throws
IOException

public boolean isLocked ()

Returns
  • true if a valid lock file (per this monitor settings) exists and is recent enough to be valid

public void lock ()

Create and refresh a valid lock file (per this monitor setting). This call should be mirrored by a call to #unlock() when monitoring is to stop.

public void unlock (boolean unregister)

Throws
InterruptedException