mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-14 08:56:15 +00:00
Rename local variables in ExternalResultsImporter (derp, derf, etc.)
This commit is contained in:
parent
0c3430b0d9
commit
5f003b4cf2
@ -77,20 +77,20 @@ public class ExternalResultsImporter {
|
|||||||
private static void generateDerivedFiles(Content dataSource, ExternalResults results) {
|
private static void generateDerivedFiles(Content dataSource, ExternalResults results) {
|
||||||
try {
|
try {
|
||||||
FileManager fileManager = Case.getCurrentCase().getServices().getFileManager();
|
FileManager fileManager = Case.getCurrentCase().getServices().getFileManager();
|
||||||
for (ExternalResults.DerivedFileData derf : results.getDerivedFiles()) {
|
for (ExternalResults.DerivedFileData derivedFile : results.getDerivedFiles()) {
|
||||||
String derp = derf.localPath;
|
String path = derivedFile.localPath;
|
||||||
File fileObj = new File(derp);
|
File fileObj = new File(path);
|
||||||
if (fileObj.exists()) {
|
if (fileObj.exists()) {
|
||||||
String fileName = derp;
|
String fileName = path;
|
||||||
int charPos = derp.lastIndexOf(File.separator);
|
int charPos = path.lastIndexOf(File.separator);
|
||||||
if (charPos > 0) {
|
if (charPos > 0) {
|
||||||
fileName = derp.substring(charPos + 1);
|
fileName = path.substring(charPos + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get a parent object for the new derived object
|
// Get a parent object for the new derived object
|
||||||
AbstractFile parentFile;
|
AbstractFile parentFile;
|
||||||
if (!derf.parentPath.isEmpty()) {
|
if (!derivedFile.parentPath.isEmpty()) {
|
||||||
parentFile = findFileInDatabase(derf.parentPath);
|
parentFile = findFileInDatabase(derivedFile.parentPath);
|
||||||
} else { //if no parent specified, try to use the root directory (//)
|
} else { //if no parent specified, try to use the root directory (//)
|
||||||
List<AbstractFile> files = Case.getCurrentCase().getSleuthkitCase().findFiles(dataSource, "");
|
List<AbstractFile> files = Case.getCurrentCase().getSleuthkitCase().findFiles(dataSource, "");
|
||||||
parentFile = files.get(0);
|
parentFile = files.get(0);
|
||||||
@ -98,8 +98,8 @@ public class ExternalResultsImporter {
|
|||||||
|
|
||||||
if (parentFile != null) {
|
if (parentFile != null) {
|
||||||
// Try to get a relative local path
|
// Try to get a relative local path
|
||||||
String relPath = derp;
|
String relPath = path;
|
||||||
Path pathTo = Paths.get(derp);
|
Path pathTo = Paths.get(path);
|
||||||
if (pathTo.isAbsolute()) {
|
if (pathTo.isAbsolute()) {
|
||||||
Path pathBase = Paths.get(Case.getCurrentCase().getCaseDirectory());
|
Path pathBase = Paths.get(Case.getCurrentCase().getCaseDirectory());
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user