X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjinetd%2FRoot.java;h=078ec05767f4f12f3429e0da557dcb11eec70bf6;hb=71778e79b8d806591e9701f1798f338bdaa5e8f9;hp=d8ccc367d9c3bddf84812f06414444a3c543d972;hpb=ac27342830d303ba1043db68f295875fe3a1ef4d;p=org.ibex.jinetd.git diff --git a/src/org/ibex/jinetd/Root.java b/src/org/ibex/jinetd/Root.java index d8ccc36..078ec05 100644 --- a/src/org/ibex/jinetd/Root.java +++ b/src/org/ibex/jinetd/Root.java @@ -6,7 +6,7 @@ import java.net.*; public class Root extends Loader { - public static String root = System.getProperty("jinetd.root", "/jinetd"); + public static String root = System.getProperty("jinetd.root", null); private final Host host; private final Watched port; @@ -20,6 +20,7 @@ public class Root extends Loader { if (part.equals("host")) return host; if (part.equals("port")) return port; if (part.equals("LIB")) return super.slash(part); + if (part.endsWith(".jar")) return super.slash(part); return null; } @@ -33,7 +34,7 @@ public class Root extends Loader { Log.debug(this, "/host changed"); } else if (w.part.equals("port")) { Log.debug(this, "/port changed"); - } else if (w.getAbsolutePath().startsWith(Root.root + "/LIB/")) { + } else if (w.getAbsolutePath().endsWith(".jar")) { if (w.lastModifiedAtLastScan != -1) { Log.error(this, "jinetd upgraded; bouncing the JVM...."); reboot(); @@ -49,9 +50,9 @@ public class Root extends Loader { String ipaddr = part.indexOf('_') == -1 ? null : part.substring(0, part.indexOf('_')); String portnum = part.indexOf('_') == -1 ? part : part.substring(part.indexOf('_') + 1); try { - return new Port(this.path + File.separatorChar + part, - ipaddr == null ? null : InetAddress.getByName(ipaddr), - portnum.equals("*") ? 0 : Integer.parseInt(portnum)); + return Port.newPort(this.path + File.separatorChar + part, + ipaddr == null ? null : InetAddress.getByName(ipaddr), + portnum.equals("*") ? 0 : Integer.parseInt(portnum)); } catch (UnknownHostException e) { Log.warn(this, "can't resolve host for port directory: " + part); } catch (NumberFormatException e) { Log.warn(this, "invalid port directory: " + part); } catch (Exception e) { Log.warn(this, "error instantiating Port: " + part);