X-Git-Url: http://git.megacz.com/?p=org.ibex.jinetd.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjinetd%2FHost.java;h=d745222a367109f16367001898ee9f4b9d92d8b0;hp=96dcf13d22558a3257acc861f6f39172c08ea00b;hb=c28d954263d3a9b5f8ea3ff37368ae811ff48f6c;hpb=97722e0cfb8199cfa5bc18909d0103789e745678 diff --git a/src/org/ibex/jinetd/Host.java b/src/org/ibex/jinetd/Host.java index 96dcf13..d745222 100644 --- a/src/org/ibex/jinetd/Host.java +++ b/src/org/ibex/jinetd/Host.java @@ -32,26 +32,31 @@ public class Host extends TreeClassLoader { init(org.ibex.jinetd.Main.ROOT + "/host", "", 0, Main.getRootClassLoader()); } public static void init(String path, String host, int depth, ClassLoader pcl) { + if (!new File(path).exists() || !new File(path).isDirectory()) return; try { - InetAddress addr = InetAddress.getByName(host); - /* - boolean good = false; - try { - if (NetworkInterface.getByInetAddress(addr) != null) good = true; - if (!good) Log.warn(Host.class, "host " + host + "resolves to " + addr + " which is not local"); - } catch (Exception e) { - Log.warn(Host.class, "host " + host + "resolves to " + addr + " which is not local because:"); - Log.warn(Host.class, e); - } - if (!good) return; - */ - if (new File(path + File.separatorChar + "WEB-INF").exists()) { - String pad = ""; - while(pad.length() + host.length() < 30) pad += " "; - Log.info(Main.class, pad + host + " => " + path); - hosts.put(host, pcl = new Host(path, host, pcl)); - } - } catch (UnknownHostException e) { + Log.warn(Host.class, "resolving " + host); + InetAddress addr = InetAddress.getByName(host); + + /* + boolean good = false; + try { + if (NetworkInterface.getByInetAddress(addr) != null) good = true; + if (!good) Log.warn(Host.class, "host " + host + "resolves to " + addr + " which is not local"); + } catch (Exception e) { + Log.warn(Host.class, "host " + host + "resolves to " + addr + " which is not local because:"); + Log.warn(Host.class, e); + } + if (!good) return; + */ + + if (new File(path + File.separatorChar + "WEB-INF").exists()) { + String pad = ""; + while(pad.length() + host.length() < 30) pad += " "; + Log.info(Main.class, pad + host + " => " + path); + hosts.put(host, pcl = new Host(path, host, pcl)); + if (!"ibex.org".equals(host)) return; + } + } catch (UnknownHostException e) { if (depth >= 3) return; } String[] subdirs = new File(path).list();