allow services file to be overridden with sigar.net.services.file property

This commit is contained in:
Doug MacEachern 2005-03-15 23:21:36 +00:00
parent db88e7f04a
commit b82ab9ede1
1 changed files with 7 additions and 2 deletions

View File

@ -20,12 +20,17 @@ public class NetPortMap {
private static Map tcpServices = null; private static Map tcpServices = null;
static { static {
String defaultFile;
if (SigarLoader.IS_WIN32) { if (SigarLoader.IS_WIN32) {
SERVICE_FILE = "C:\\windows\\system32\\drivers\\etc\\services"; defaultFile = "C:\\windows\\system32\\drivers\\etc\\services";
} }
else { else {
SERVICE_FILE = "/etc/services"; defaultFile = "/etc/services";
} }
SERVICE_FILE =
System.getProperty("sigar.net.services.file", defaultFile);
} }
public static class IpEntry { public static class IpEntry {