mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 09:17:42 +00:00
Display path string and path bytes when an error occurs
This commit is contained in:
parent
faf4e9a70a
commit
f4d521cb7c
@ -1309,13 +1309,29 @@ class SevenZipExtractor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (tokens.size() != byteTokens.size()) {
|
if (tokens.size() != byteTokens.size()) {
|
||||||
logger.log(Level.WARNING, "Could not map path bytes to path string");
|
logger.log(Level.WARNING, "Could not map path bytes to path string (path string: \"{0}\", bytes: {1})",
|
||||||
|
new Object[]{filePath, bytesToString(filePathBytes)});
|
||||||
return addNode(rootNode, tokens, null);
|
return addNode(rootNode, tokens, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return addNode(rootNode, tokens, byteTokens);
|
return addNode(rootNode, tokens, byteTokens);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert byte array to string representation.
|
||||||
|
*
|
||||||
|
* @param bytes Byte array
|
||||||
|
*
|
||||||
|
* @return Byte array as lower case hex string.
|
||||||
|
*/
|
||||||
|
private String bytesToString(byte[] bytes) {
|
||||||
|
StringBuilder result = new StringBuilder();
|
||||||
|
for (byte b : bytes) {
|
||||||
|
result.append(String.format("%02x", b));
|
||||||
|
}
|
||||||
|
return result.toString();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* recursive method that traverses the path
|
* recursive method that traverses the path
|
||||||
|
Loading…
x
Reference in New Issue
Block a user