/** * Retrieves the named object. If name is empty, returns a new instance * of this context (which represents the same naming context as this * context, but its environment may be modified independently and it may * be accessed concurrently). * * @param name the name of the object to look up * @return the object bound to name * @exception NamingException if a naming exception is encountered */ public Object lookup(Name name) throws NamingException { if (name.isEmpty()) return this; Entry entry = treeLookup(name); if (entry == null) throw new NamingException (MESSAGES.resourceNotFound(name.toString())); ZipEntry zipEntry = entry.getEntry(); if (zipEntry.isDirectory()) return new WARDirContext(base, entry); else return new WARResource(entry.getEntry()); }
/** * Retrieves the named object. * * @param strName the name of the object to look up * @return the object bound to name */ @Override protected Object doLookup(String strName) { Name name; try { name = getEscapedJndiName(strName); } catch (InvalidNameException e) { log.info(sm.getString("resources.invalidName", strName), e); return null; } if (name.isEmpty()) return this; Entry entry = treeLookup(name); if (entry == null) return null; ZipEntry zipEntry = entry.getEntry(); if (zipEntry.isDirectory()) return new WARDirContext(base, entry); else return new WARResource(entry.getEntry()); }
/** * Retrieves the named object. * * @param strName the name of the object to look up * @return the object bound to name */ @Override protected Object doLookup(String strName) { Name name; try { name = getEscapedJndiName(strName); } catch (InvalidNameException e) { log.info(sm.getString("resources.invalidName", strName), e); return null; } if (name.isEmpty()) return this; Entry entry = treeLookup(name); if (entry == null) return null; ZipEntry zipEntry = entry.getEntry(); if (zipEntry.isDirectory()) return new WARDirContext(base, entry); else return new WARResource(entry.getEntry()); }
/** * Retrieves the named object. If name is empty, returns a new instance * of this context (which represents the same naming context as this * context, but its environment may be modified independently and it may * be accessed concurrently). * * @param name the name of the object to look up * @return the object bound to name * @exception NamingException if a naming exception is encountered */ public Object lookup(Name name) throws NamingException { if (name.isEmpty()) return this; Entry entry = treeLookup(name); if (entry == null) throw new NamingException (sm.getString("resources.notFound", name)); ZipEntry zipEntry = entry.getEntry(); if (zipEntry.isDirectory()) return new WARDirContext(base, entry); else return new WARResource(entry.getEntry()); }
/** * Retrieves the named object. * * @param strName the name of the object to look up * @return the object bound to name */ @Override protected Object doLookup(String strName) { Name name; try { name = getEscapedJndiName(strName); } catch (InvalidNameException e) { log.info(sm.getString("resources.invalidName", strName), e); return null; } if (name.isEmpty()) return this; Entry entry = treeLookup(name); if (entry == null) return null; ZipEntry zipEntry = entry.getEntry(); if (zipEntry.isDirectory()) return new WARDirContext(base, entry); else return new WARResource(entry.getEntry()); }
/** * Retrieves the named object. * * @param strName the name of the object to look up * @return the object bound to name */ @Override protected Object doLookup(String strName) { Name name; try { name = getEscapedJndiName(strName); } catch (InvalidNameException e) { log.info(sm.getString("resources.invalidName", strName), e); return null; } if (name.isEmpty()) return this; Entry entry = treeLookup(name); if (entry == null) return null; ZipEntry zipEntry = entry.getEntry(); if (zipEntry.isDirectory()) return new WARDirContext(base, entry); else return new WARResource(entry.getEntry()); }
/** * List children as objects. */ protected ArrayList<NamingEntry> list(Entry entry) { ArrayList<NamingEntry> entries = new ArrayList<NamingEntry>(); Entry[] children = entry.getChildren(); Arrays.sort(children); NamingEntry namingEntry = null; for (int i = 0; i < children.length; i++) { ZipEntry current = children[i].getEntry(); Object object = null; if (current.isDirectory()) { object = new WARDirContext(base, children[i]); } else { object = new WARResource(current); } namingEntry = new NamingEntry (children[i].getName(), object, NamingEntry.ENTRY); entries.add(namingEntry); } return entries; }
/** * List children as objects. */ protected ArrayList list(Entry entry) { ArrayList entries = new ArrayList(); Entry[] children = entry.getChildren(); Arrays.sort(children); NamingEntry namingEntry = null; for (int i = 0; i < children.length; i++) { ZipEntry current = children[i].getEntry(); Object object = null; if (current.isDirectory()) { object = new WARDirContext(base, children[i]); } else { object = new WARResource(current); } namingEntry = new NamingEntry (children[i].getName(), object, NamingEntry.ENTRY); entries.add(namingEntry); } return entries; }
/** * List children as objects. */ protected ArrayList<NamingEntry> list(Entry entry) { ArrayList<NamingEntry> entries = new ArrayList<NamingEntry>(); Entry[] children = entry.getChildren(); Arrays.sort(children); NamingEntry namingEntry = null; for (int i = 0; i < children.length; i++) { ZipEntry current = children[i].getEntry(); Object object = null; if (current.isDirectory()) { object = new WARDirContext(base, children[i]); } else { object = new WARResource(current); } namingEntry = new NamingEntry (children[i].getName(), object, NamingEntry.ENTRY); entries.add(namingEntry); } return entries; }
/** * Retrieves the named object. * * @param strName the name of the object to look up * @return the object bound to name */ @Override protected Object doLookup(String strName) { Name name; try { name = getEscapedJndiName(strName); } catch (InvalidNameException e) { log.info(sm.getString("resources.invalidName", strName), e); return null; } if (name.isEmpty()) return this; Entry entry = treeLookup(name); if (entry == null) return null; ZipEntry zipEntry = entry.getEntry(); if (zipEntry.isDirectory()) return new WARDirContext(base, entry); else return new WARResource(entry.getEntry()); }
/** * List children as objects. */ protected ArrayList<NamingEntry> list(Entry entry) { ArrayList<NamingEntry> entries = new ArrayList<NamingEntry>(); Entry[] children = entry.getChildren(); Arrays.sort(children); NamingEntry namingEntry = null; for (int i = 0; i < children.length; i++) { ZipEntry current = children[i].getEntry(); Object object = null; if (current.isDirectory()) { object = new WARDirContext(base, children[i]); } else { object = new WARResource(current); } namingEntry = new NamingEntry (children[i].getName(), object, NamingEntry.ENTRY); entries.add(namingEntry); } return entries; }
/** * List children as objects. */ protected ArrayList list(Entry entry) { ArrayList entries = new ArrayList(); Entry[] children = entry.getChildren(); Arrays.sort(children); NamingEntry namingEntry = null; for (int i = 0; i < children.length; i++) { ZipEntry current = children[i].getEntry(); Object object = null; if (current.isDirectory()) { object = new WARDirContext(base, children[i]); } else { object = new WARResource(current); } namingEntry = new NamingEntry (children[i].getName(), object, NamingEntry.ENTRY); entries.add(namingEntry); } return entries; }
/** * List children as objects. */ protected ArrayList<NamingEntry> list(Entry entry) { ArrayList<NamingEntry> entries = new ArrayList<NamingEntry>(); Entry[] children = entry.getChildren(); Arrays.sort(children); NamingEntry namingEntry = null; for (int i = 0; i < children.length; i++) { ZipEntry current = children[i].getEntry(); Object object = null; if (current.isDirectory()) { object = new WARDirContext(base, children[i]); } else { object = new WARResource(current); } namingEntry = new NamingEntry (children[i].getName(), object, NamingEntry.ENTRY); entries.add(namingEntry); } return entries; }
/** * List children as objects. */ protected ArrayList<NamingEntry> list(Entry entry) { ArrayList<NamingEntry> entries = new ArrayList<NamingEntry>(); Entry[] children = entry.getChildren(); Arrays.sort(children); NamingEntry namingEntry = null; for (int i = 0; i < children.length; i++) { ZipEntry current = children[i].getEntry(); Object object = null; if (current.isDirectory()) { object = new WARDirContext(base, children[i]); } else { object = new WARResource(current); } namingEntry = new NamingEntry (children[i].getName(), object, NamingEntry.ENTRY); entries.add(namingEntry); } return entries; }