You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Al Dispennette <Al...@clairmail.com> on 2011/12/14 23:16:25 UTC

[users@httpd] URResourceFactory

Can anyone tell me if there is an equivalent of URLResourceFactory in that apache API?

public class URLResourceFactory implements ObjectFactory {
                public Object getObjectInstance(Object obj, Name name, Context nameCtx,
                                                Hashtable environment) throws Exception {
                                Reference ref = (Reference) obj;
                                Resource resource = null;
                                String urlString = (String) ref.get("url").getContent();
                                try{
                                                return new URL(urlString).getContent();
                                }catch (Exception e) {
                                                System.err.println("JNDI Look up failed");
                                                return null;
                                }
                }
}