VFSItem file = resolveFile(name);
if (file != null) throw new NameAlreadyBoundException(smgr.getString("resources.alreadyBound", name));
int lastSlash = name.lastIndexOf('/');
if (lastSlash == -1) throw new NamingException();
String parent = name.substring(0, lastSlash);
VFSItem folder = resolveFile(parent);
if (folder == null || (!(folder instanceof VFSContainer)))
throw new NamingException(smgr.getString("resources.bindFailed", name));
String newName = name.substring(lastSlash + 1);
VFSItem childContainer = ((VFSContainer)folder).createChildContainer(newName);
if (childContainer == null)
throw new NamingException(smgr.getString("resources.bindFailed", name));
return (DirContext)lookup(name);
}