Skip to content
Snippets Groups Projects
Commit ccc72e56 authored by Richard Cordovano's avatar Richard Cordovano
Browse files

Format SleuthkitJNI.java

parent be51ce5d
No related branches found
No related tags found
No related merge requests found
...@@ -50,11 +50,11 @@ public class SleuthkitJNI { ...@@ -50,11 +50,11 @@ public class SleuthkitJNI {
/** /**
* Lock to protect against the TSK data structures being closed while * Lock to protect against the TSK data structures being closed while
* another thread is in the C++ code. Do not use this lock after obtaining * another thread is in the C++ code. Do not use this lock after obtaining
* HandleCache.cacheLock. Additionally, the only code that should acquire the * HandleCache.cacheLock. Additionally, the only code that should acquire
* write lock is CaseDbHandle.free(). * the write lock is CaseDbHandle.free().
*/ */
private static final ReadWriteLock tskLock = new ReentrantReadWriteLock(); private static final ReadWriteLock tskLock = new ReentrantReadWriteLock();
/* /*
* Loads the SleuthKit libraries. * Loads the SleuthKit libraries.
*/ */
...@@ -274,7 +274,7 @@ public class AddImageProcess { ...@@ -274,7 +274,7 @@ public class AddImageProcess {
private volatile long tskAutoDbPointer; private volatile long tskAutoDbPointer;
private boolean isCanceled; private boolean isCanceled;
private final SleuthkitCase skCase; private final SleuthkitCase skCase;
/** /**
* Constructs an object that encapsulates a multi-step process to * Constructs an object that encapsulates a multi-step process to
* add an image to the case database. * add an image to the case database.
...@@ -441,7 +441,7 @@ public synchronized String currentDirectory() { ...@@ -441,7 +441,7 @@ public synchronized String currentDirectory() {
public void run(String[] imageFilePaths) throws TskCoreException, TskDataException { public void run(String[] imageFilePaths) throws TskCoreException, TskDataException {
run(null, imageFilePaths, 0); run(null, imageFilePaths, 0);
} }
/** /**
* Starts the process of adding an image to the case database. * Starts the process of adding an image to the case database.
* Either AddImageProcess.commit or AddImageProcess.revert MUST be * Either AddImageProcess.commit or AddImageProcess.revert MUST be
...@@ -539,7 +539,7 @@ public static String getVersion() { ...@@ -539,7 +539,7 @@ public static String getVersion() {
/** /**
* Enable verbose logging and redirect stderr to the given log file. * Enable verbose logging and redirect stderr to the given log file.
* *
* @param logPath the log file path * @param logPath the log file path
*/ */
public static void startVerboseLogging(String logPath) { public static void startVerboseLogging(String logPath) {
...@@ -559,16 +559,16 @@ public static void startVerboseLogging(String logPath) { ...@@ -559,16 +559,16 @@ public static void startVerboseLogging(String logPath) {
public static long openImage(String[] imageFiles) throws TskCoreException { public static long openImage(String[] imageFiles) throws TskCoreException {
return openImage(imageFiles, 0, true); return openImage(imageFiles, 0, true);
} }
/** /**
* Open the image with a specified sector size and return the image info * Open the image with a specified sector size and return the image info
* pointer. * pointer.
* *
* @param imageFiles the paths to the images * @param imageFiles the paths to the images
* @param sSize the sector size (use '0' for autodetect) * @param sSize the sector size (use '0' for autodetect)
* *
* @return the image info pointer * @return the image info pointer
* *
* @throws TskCoreException exception thrown if critical error occurs within * @throws TskCoreException exception thrown if critical error occurs within
* TSK * TSK
*/ */
...@@ -689,10 +689,10 @@ public static long openFs(long imgHandle, long fsOffset) throws TskCoreException ...@@ -689,10 +689,10 @@ public static long openFs(long imgHandle, long fsOffset) throws TskCoreException
long fsHandle; long fsHandle;
synchronized (HandleCache.cacheLock) { synchronized (HandleCache.cacheLock) {
final Map<Long, Long> imgOffSetToFsHandle = HandleCache.fsHandleCache.get(imgHandle); final Map<Long, Long> imgOffSetToFsHandle = HandleCache.fsHandleCache.get(imgHandle);
if (imgOffSetToFsHandle == null) { if (imgOffSetToFsHandle == null) {
throw new TskCoreException("Missing image offset to file system handle cache for image handle " + imgHandle); throw new TskCoreException("Missing image offset to file system handle cache for image handle " + imgHandle);
} }
if (imgOffSetToFsHandle.containsKey(fsOffset)) { if (imgOffSetToFsHandle.containsKey(fsOffset)) {
//return cached //return cached
fsHandle = imgOffSetToFsHandle.get(fsOffset); fsHandle = imgOffSetToFsHandle.get(fsOffset);
} else { } else {
...@@ -1086,7 +1086,7 @@ public static void closeAllHashDatabases() throws TskCoreException { ...@@ -1086,7 +1086,7 @@ public static void closeAllHashDatabases() throws TskCoreException {
* affected. * affected.
* *
* @param dbHandle Handle of database to close. * @param dbHandle Handle of database to close.
* *
* @throws TskCoreException exception thrown if critical error occurs within * @throws TskCoreException exception thrown if critical error occurs within
* TSK * TSK
*/ */
...@@ -1098,7 +1098,7 @@ public static void closeHashDatabase(int dbHandle) throws TskCoreException { ...@@ -1098,7 +1098,7 @@ public static void closeHashDatabase(int dbHandle) throws TskCoreException {
* Get the name of the database * Get the name of the database
* *
* @param dbHandle Previously opened hash db handle. * @param dbHandle Previously opened hash db handle.
* *
* @return The display name. * @return The display name.
* *
* @throws TskCoreException if a critical error occurs within TSK core * @throws TskCoreException if a critical error occurs within TSK core
...@@ -1217,7 +1217,7 @@ private static String timezoneLongToShort(String timezoneLongForm) { ...@@ -1217,7 +1217,7 @@ private static String timezoneLongToShort(String timezoneLongForm) {
* Fills in any gaps in the image created by image writer. * Fills in any gaps in the image created by image writer.
* *
* @param imgHandle The image handle. * @param imgHandle The image handle.
* *
* @return 0 if no errors occurred; 1 otherwise. * @return 0 if no errors occurred; 1 otherwise.
* *
* @throws TskCoreException exception thrown if critical error occurs within * @throws TskCoreException exception thrown if critical error occurs within
...@@ -1280,7 +1280,7 @@ public static long findDeviceSize(String devPath) throws TskCoreException { ...@@ -1280,7 +1280,7 @@ public static long findDeviceSize(String devPath) throws TskCoreException {
public static boolean isImageSupported(String imagePath) { public static boolean isImageSupported(String imagePath) {
return isImageSupportedNat(imagePath); return isImageSupportedNat(imagePath);
} }
/** /**
* Get a read lock for the C++ layer. Do not get this lock after obtaining * Get a read lock for the C++ layer. Do not get this lock after obtaining
* HandleCache.cacheLock. * HandleCache.cacheLock.
...@@ -1288,19 +1288,18 @@ public static boolean isImageSupported(String imagePath) { ...@@ -1288,19 +1288,18 @@ public static boolean isImageSupported(String imagePath) {
private static void getTSKReadLock() { private static void getTSKReadLock() {
tskLock.readLock().lock(); tskLock.readLock().lock();
} }
/** /**
* Release the read lock * Release the read lock
*/ */
private static void releaseTSKReadLock() { private static void releaseTSKReadLock() {
tskLock.readLock().unlock(); tskLock.readLock().unlock();
} }
//free pointers //free pointers
/** /**
* frees the imgHandle pointer currently does not close the image - imgHandle * frees the imgHandle pointer currently does not close the image -
* should only be freed as part of CaseDbHandle.free(). * imgHandle should only be freed as part of CaseDbHandle.free().
* *
* @param imgHandle to close the image * @param imgHandle to close the image
*/ */
...@@ -1316,7 +1315,7 @@ public static void closeImg(long imgHandle) { ...@@ -1316,7 +1315,7 @@ public static void closeImg(long imgHandle) {
*/ */
@Deprecated @Deprecated
public static void closeVs(long vsHandle) { public static void closeVs(long vsHandle) {
// closeVsNat(vsHandle); TODO JIRA-3829 // closeVsNat(vsHandle); TODO JIRA-3829
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment