mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-08 06:09:32 +00:00
Merge branch 'develop' of github.com:sleuthkit/autopsy into 7291-hostsManagement
This commit is contained in:
commit
c56ded6fb6
@ -24,7 +24,6 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.logging.Level;
|
||||
import org.openide.nodes.ChildFactory;
|
||||
@ -101,7 +100,7 @@ public class HostNode extends DisplayableItemNode {
|
||||
|
||||
@Override
|
||||
protected boolean createKeys(List<DataSourceGrouping> toPopulate) {
|
||||
Set<DataSource> dataSources = null;
|
||||
List<DataSource> dataSources = null;
|
||||
try {
|
||||
dataSources = Case.getCurrentCaseThrows().getSleuthkitCase().getHostManager().getDataSourcesForHost(host);
|
||||
} catch (NoCurrentCaseException | TskCoreException ex) {
|
||||
|
@ -770,61 +770,10 @@ public class Server {
|
||||
/**
|
||||
* Checks to see if a specific port is available.
|
||||
*
|
||||
* @param port the port to check for availability
|
||||
* @param port The port to check for availability.
|
||||
* @return True if the port is available and false if not.
|
||||
*/
|
||||
static boolean isPortAvailable(int port) {
|
||||
final String osName = PlatformUtil.getOSName().toLowerCase();
|
||||
if (osName != null && osName.toLowerCase().startsWith("mac")) {
|
||||
return isPortAvailableOSX(port);
|
||||
} else {
|
||||
return isPortAvailableDefault(port);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if a specific port is available.
|
||||
*
|
||||
* NOTE: This is used on non-OS X systems as of right now but could be
|
||||
* replaced with the OS X version.
|
||||
*
|
||||
* @param port the port to check for availability
|
||||
*/
|
||||
static boolean isPortAvailableDefault(int port) {
|
||||
ServerSocket ss = null;
|
||||
try {
|
||||
|
||||
ss = new ServerSocket(port, 0, java.net.Inet4Address.getByName("localhost")); //NON-NLS
|
||||
if (ss.isBound()) {
|
||||
ss.setReuseAddress(true);
|
||||
ss.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
} finally {
|
||||
if (ss != null) {
|
||||
try {
|
||||
ss.close();
|
||||
} catch (IOException e) {
|
||||
/*
|
||||
* should not be thrown
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if a specific port is available.
|
||||
*
|
||||
* NOTE: This is only used on OSX for now, but could replace default
|
||||
* implementation in the future.
|
||||
*
|
||||
* @param port The port to check for availability.
|
||||
* @throws IllegalArgumentException If port is outside range of possible ports.
|
||||
*/
|
||||
static boolean isPortAvailableOSX(int port) {
|
||||
// implementation taken from https://stackoverflow.com/a/435579
|
||||
if (port < 1 || port > 65535) {
|
||||
throw new IllegalArgumentException("Invalid start port: " + port);
|
||||
|
@ -344,10 +344,13 @@ class TestRunner(object):
|
||||
"""
|
||||
copied = False
|
||||
|
||||
# string for whether or it is single user or multi user for diff
|
||||
mu_su_str = "multi" if test_data.isMultiUser else "single"
|
||||
|
||||
for file in glob.glob(test_data.output_path + "/*-Diff.txt"):
|
||||
# Eg. copies HTML-Report-Diff.txt to <Image-name>-HTML-Report-Diff.txt
|
||||
shutil.copy(file, test_data.main_config.args.diff_files_output_folder +
|
||||
"/" + test_data.image + "-" + os.path.basename(file))
|
||||
"/" + test_data.image + "-" + mus_su_str + "-" + os.path.basename(file))
|
||||
copied = True
|
||||
if not copied:
|
||||
print_report([], "NO DIFF FILES COPIED FROM " + test_data.output_path, "")
|
||||
|
Loading…
x
Reference in New Issue
Block a user