mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Added some of the codacy suggestions
This commit is contained in:
parent
7b371dc125
commit
f583d30990
@ -475,8 +475,6 @@ class SevenZipExtractor {
|
|||||||
List<AbstractFile> unpackedFiles = Collections.<AbstractFile>emptyList();
|
List<AbstractFile> unpackedFiles = Collections.<AbstractFile>emptyList();
|
||||||
ISevenZipInArchive inArchive = null;
|
ISevenZipInArchive inArchive = null;
|
||||||
|
|
||||||
Map<Integer, InArchiveItemDetails> archiveDetailsMap = new LinkedHashMap<>();
|
|
||||||
|
|
||||||
SevenZipContentReadStream stream = null;
|
SevenZipContentReadStream stream = null;
|
||||||
final ProgressHandle progress = ProgressHandle.createHandle(Bundle.EmbeddedFileExtractorIngestModule_ArchiveExtractor_moduleName());
|
final ProgressHandle progress = ProgressHandle.createHandle(Bundle.EmbeddedFileExtractorIngestModule_ArchiveExtractor_moduleName());
|
||||||
//recursion depth check for zip bomb
|
//recursion depth check for zip bomb
|
||||||
@ -562,6 +560,7 @@ class SevenZipExtractor {
|
|||||||
freeDiskSpace = IngestMonitor.DISK_FREE_SPACE_UNKNOWN;
|
freeDiskSpace = IngestMonitor.DISK_FREE_SPACE_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Map<Integer, InArchiveItemDetails> archiveDetailsMap = new LinkedHashMap<>();
|
||||||
for (int inArchiveItemIndex = 0; inArchiveItemIndex < numItems; inArchiveItemIndex++) {
|
for (int inArchiveItemIndex = 0; inArchiveItemIndex < numItems; inArchiveItemIndex++) {
|
||||||
String pathInArchive = getPathInArchive(inArchive, inArchiveItemIndex, archiveFile);
|
String pathInArchive = getPathInArchive(inArchive, inArchiveItemIndex, archiveFile);
|
||||||
String archiveItemPath = (String) inArchive.getProperty(
|
String archiveItemPath = (String) inArchive.getProperty(
|
||||||
@ -662,7 +661,7 @@ class SevenZipExtractor {
|
|||||||
//inArchiveItemIndex.
|
//inArchiveItemIndex.
|
||||||
inArchive.extract(extractionIndices, false, archiveCallBack);
|
inArchive.extract(extractionIndices, false, archiveCallBack);
|
||||||
|
|
||||||
unpackSuccessful = unpackSuccessful & archiveCallBack.getSuccessFlag();
|
unpackSuccessful = unpackSuccessful & archiveCallBack.wasSuccessful();
|
||||||
|
|
||||||
// add them to the DB. We wait until the end so that we have the metadata on all of the
|
// add them to the DB. We wait until the end so that we have the metadata on all of the
|
||||||
// intermediate nodes since the order is not guaranteed
|
// intermediate nodes since the order is not guaranteed
|
||||||
@ -917,9 +916,9 @@ class SevenZipExtractor {
|
|||||||
*/
|
*/
|
||||||
private static class InArchiveItemDetails {
|
private static class InArchiveItemDetails {
|
||||||
|
|
||||||
private SevenZipExtractor.UnpackedTree.UnpackedNode unpackedNode;
|
private final SevenZipExtractor.UnpackedTree.UnpackedNode unpackedNode;
|
||||||
private String localAbsPath;
|
private final String localAbsPath;
|
||||||
private String localRelPath;
|
private final String localRelPath;
|
||||||
|
|
||||||
public InArchiveItemDetails(
|
public InArchiveItemDetails(
|
||||||
SevenZipExtractor.UnpackedTree.UnpackedNode unpackedNode,
|
SevenZipExtractor.UnpackedTree.UnpackedNode unpackedNode,
|
||||||
@ -949,21 +948,21 @@ class SevenZipExtractor {
|
|||||||
private static class StandardIArchiveExtractCallback
|
private static class StandardIArchiveExtractCallback
|
||||||
implements IArchiveExtractCallback, ICryptoGetTextPassword {
|
implements IArchiveExtractCallback, ICryptoGetTextPassword {
|
||||||
|
|
||||||
private AbstractFile archiveFile;
|
private final AbstractFile archiveFile;
|
||||||
private ISevenZipInArchive inArchive;
|
private final ISevenZipInArchive inArchive;
|
||||||
private SevenZipExtractor.UnpackStream unpackStream = null;
|
private SevenZipExtractor.UnpackStream unpackStream = null;
|
||||||
private Map<Integer, InArchiveItemDetails> archiveDetailsMap;
|
private final Map<Integer, InArchiveItemDetails> archiveDetailsMap;
|
||||||
private ProgressHandle progressHandle;
|
private final ProgressHandle progressHandle;
|
||||||
|
|
||||||
private int inArchiveItemIndex;
|
private int inArchiveItemIndex;
|
||||||
private long freeDiskSpace;
|
private final long freeDiskSpace;
|
||||||
|
|
||||||
private long createTimeInSeconds;
|
private long createTimeInSeconds;
|
||||||
private long modTimeInSeconds;
|
private long modTimeInSeconds;
|
||||||
private long accessTimeInSeconds;
|
private long accessTimeInSeconds;
|
||||||
|
|
||||||
private boolean isFolder;
|
private boolean isFolder;
|
||||||
private String password;
|
private final String password;
|
||||||
|
|
||||||
private boolean unpackSuccessful = true;
|
private boolean unpackSuccessful = true;
|
||||||
|
|
||||||
@ -1070,11 +1069,11 @@ class SevenZipExtractor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setTotal(long l) throws SevenZipException {
|
public void setTotal(long value) throws SevenZipException {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCompleted(long l) throws SevenZipException {
|
public void setCompleted(long value) throws SevenZipException {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1089,7 +1088,7 @@ class SevenZipExtractor {
|
|||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getSuccessFlag() {
|
public boolean wasSuccessful() {
|
||||||
return unpackSuccessful;
|
return unpackSuccessful;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user