JNDI Cast
Hello,
I'm learning JNDI with com.sun.jndi.fscontext.RefFSContextFactory.
I've got a problem. I try to list a directory and I get Objects. But I can't cast them into an instance of File.
I do this :
_p = new java.util.Properties();
_p.setProperty(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.fscontext.RefFSContextFactory");
_p.setProperty(Context.PROVIDER_URL,"file:///JAVA");
_ic = new InitialContext(_p);
NamingEnumeration ne = _ic.listBindings("serialisation");
while(ne.hasMore()) {
Object o = ne.next();
File f = (File) o;
System.out.println("Named object and its class in the context, " + o.toString());
}
But I got a CastException. Is this possible to get an instance of File from an Object ?
Thanks in advance !!

