/** Tries to find a resource. * @param en enumeration of strings to scan * @return found object or null */ final FileObject find(Enumeration<String> en) { AbstractFolder fo = this; while ((fo != null) && en.hasMoreElements()) { // try to go on // lock to provide safety for getChild synchronized (fo) { // JST: Better to call the check only here, // than in getChild, than it is not called // so often. fo.check(); final String next = en.nextElement(); if ("..".equals(next)) { fo = (AbstractFolder)fo.getParent(); } else { fo = fo.getChild(next); } } } // no next requirements or not found return fo; }