Sleuth Kit Java Bindings (JNI)  4.12.1
Java bindings for using The Sleuth Kit
org.sleuthkit.datamodel.LibraryLock Class Reference

Inherits AutoCloseable.

Classes

enum  LockState
 

Public Member Functions

void close () throws Exception
 
File getLibTskJniFile ()
 
LockState getLockState ()
 

Static Public Member Functions

static LibraryLock acquireLibLock ()
 
static void removeLibLock () throws Exception
 

Detailed Description

Creates a file lock for the libtsk_jni library in the temp directory determined by "java.io.tmpdir". The goal of this class is to prevent another application from using TSK libraries in the java.io.tmpdir at the same time that this lock has been placed. In order for this class to be used effectively, the system property "tsk.tmpdir" should also be specified so that LibraryUtils uses the "tsk.tmpdir" path to write libraries instead of the standard "java.io.tempdir".

Definition at line 38 of file LibraryLock.java.

Member Function Documentation

static LibraryLock org.sleuthkit.datamodel.LibraryLock.acquireLibLock ( )
static

Attempts to acquire a file lock on the libtsk_jni library at the old location if there currently is no lock.

Returns
The result of attempting to obtain the lock including the result type (lock held by new application, lock held by old application, lock acquired) and any resources if the lock is acquired.
Exceptions
IOException

Definition at line 59 of file LibraryLock.java.

void org.sleuthkit.datamodel.LibraryLock.close ( ) throws Exception

Definition at line 210 of file LibraryLock.java.

Referenced by org.sleuthkit.datamodel.LibraryLock.removeLibLock().

File org.sleuthkit.datamodel.LibraryLock.getLibTskJniFile ( )

Returns the file path for the lib tsk jni file.

Returns
The file path for the lib tsk jni file.

Definition at line 205 of file LibraryLock.java.

LockState org.sleuthkit.datamodel.LibraryLock.getLockState ( )

The lock state result of attempting to lock the libtsk_jni library temp file.

Returns
The lock state result of attempting to lock the file.

Definition at line 196 of file LibraryLock.java.

static void org.sleuthkit.datamodel.LibraryLock.removeLibLock ( ) throws Exception
static

Removes any library file lock present.

Exceptions
ExceptionIf there is an error closing the lock resources.

Definition at line 71 of file LibraryLock.java.

References org.sleuthkit.datamodel.LibraryLock.close().


The documentation for this class was generated from the following file:

Copyright © 2011-2024 Brian Carrier. (carrier -at- sleuthkit -dot- org)
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.