Class WebDirContext

  • All Implemented Interfaces:
    Context, DirContext

    public class WebDirContext
    extends FileDirContext
    Filesystem Directory Web Context implementation helper class.
    Author:
    Shing Wai Chan
    • Constructor Detail

      • WebDirContext

        public WebDirContext()
        Builds a file directory context using the given environment.
      • WebDirContext

        public WebDirContext​(Hashtable<String,​Object> env)
        Builds a file directory context using the given environment.
    • Method Detail

      • setJarFileResourcesProvider

        public void setJarFileResourcesProvider​(JarFileResourcesProvider jarFileResourcesProvider)
      • release

        public void release()
        Release any resources allocated for this directory context.
        Overrides:
        release in class FileDirContext
      • list

        public NamingEnumeration<NameClassPair> list​(String name)
                                              throws NamingException
        Enumerates the names bound in the named context, along with the class names of objects bound to them. The contents of any subcontexts are not included.

        If a binding is added to or removed from this context, its effect on an enumeration previously returned is undefined.

        Specified by:
        list in interface Context
        Overrides:
        list in class FileDirContext
        Parameters:
        name - the name of the context to list
        Returns:
        an enumeration of the names and class names of the bindings in this context. Each element of the enumeration is of type NameClassPair.
        Throws:
        NamingException - if a naming exception is encountered
      • listBindings

        public NamingEnumeration<Binding> listBindings​(String name)
                                                throws NamingException
        Enumerates the names bound in the named context, along with the objects bound to them. The contents of any subcontexts are not included.

        If a binding is added to or removed from this context, its effect on an enumeration previously returned is undefined.

        Specified by:
        listBindings in interface Context
        Overrides:
        listBindings in class FileDirContext
        Parameters:
        name - the name of the context to list
        Returns:
        an enumeration of the bindings in this context. Each element of the enumeration is of type Binding.
        Throws:
        NamingException - if a naming exception is encountered
      • getAttributes

        public Attributes getAttributes​(String name,
                                        String[] attrIds)
                                 throws NamingException
        Retrieves selected attributes associated with a named object. See the class description regarding attribute models, attribute type names, and operational attributes.
        Specified by:
        getAttributes in interface DirContext
        Overrides:
        getAttributes in class FileDirContext
        Parameters:
        name - the name of the object from which to retrieve attributes
        attrIds - the identifiers of the attributes to retrieve. null indicates that all attributes should be retrieved; an empty array indicates that none should be retrieved
        Returns:
        the requested attributes; never null
        Throws:
        NamingException - if a naming exception is encountered
      • getAbsoluteJarResourceName

        protected String getAbsoluteJarResourceName​(String name)