Skip to content
Snippets Groups Projects
Commit 87314fb3 authored by Brian Carrier's avatar Brian Carrier
Browse files

make smaller error message when local file cannot be read

parent eeba90bf
No related branches found
No related tags found
No related merge requests found
...@@ -694,7 +694,7 @@ protected final int readLocal(byte[] buf, long offset, long len) throws TskCoreE ...@@ -694,7 +694,7 @@ protected final int readLocal(byte[] buf, long offset, long len) throws TskCoreE
try { try {
localFileHandle = new RandomAccessFile(localFile, "r"); localFileHandle = new RandomAccessFile(localFile, "r");
} catch (FileNotFoundException ex) { } catch (FileNotFoundException ex) {
final String msg = "Error reading local file: " + this.toString(); final String msg = "Error reading local file: " + localAbsPath;
logger.log(Level.SEVERE, msg, ex); logger.log(Level.SEVERE, msg, ex);
//file could have been deleted or moved //file could have been deleted or moved
throw new TskCoreException(msg, ex); throw new TskCoreException(msg, ex);
...@@ -712,7 +712,7 @@ protected final int readLocal(byte[] buf, long offset, long len) throws TskCoreE ...@@ -712,7 +712,7 @@ protected final int readLocal(byte[] buf, long offset, long len) throws TskCoreE
//note, we are always writing at 0 offset of user buffer //note, we are always writing at 0 offset of user buffer
bytesRead = localFileHandle.read(buf, 0, (int) len); bytesRead = localFileHandle.read(buf, 0, (int) len);
} catch (IOException ex) { } catch (IOException ex) {
final String msg = "Cannot read local file: " + this.toString(); final String msg = "Cannot read local file: " + localAbsPath;
logger.log(Level.SEVERE, msg, ex); logger.log(Level.SEVERE, msg, ex);
//local file could have been deleted / moved //local file could have been deleted / moved
throw new TskCoreException(msg, ex); throw new TskCoreException(msg, ex);
...@@ -828,7 +828,7 @@ public void close() { ...@@ -828,7 +828,7 @@ public void close() {
try { try {
localFileHandle.close(); localFileHandle.close();
} catch (IOException ex) { } catch (IOException ex) {
logger.log(Level.SEVERE, "Could not close file handle for file: " + this.toString(), ex); logger.log(Level.SEVERE, "Could not close file handle for file: " + getParentPath() + "/" + getName(), ex);
} }
localFileHandle = null; localFileHandle = null;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment