bean = new WebDAVBean(resource); url = resource.getPath(); url = url.replaceFirst(webDAVServletURL, ""); bean.setWebDavHttpURL(url); bean.setIconTheme(iconTheme); v.add(bean);
try { bean = new WebDAVBean(resource); url = resource.getPath(); url = url.replaceFirst(webDAVServletURL, ""); bean.setWebDavHttpURL(url); bean.setIconTheme(iconTheme); v.add(bean); } catch (ClassCastException e) {   e.printStackTrace(); }
	private WebDAVBean[] getDirectoryListing(WebdavExtendedResource headResource, String webDAVServletURL)	throws IOException, HttpException {		WebdavResources resources = headResource.listWithDeltaV();//headResource.getChildResources();		Enumeration enumer = resources.getResources();		List v = new Vector();		WebDAVBean bean;		WebDAVBean upBean = null;		WebdavExtendedResource resource;		String url;		if (webDAVPath != null && !"".equals(webDAVPath) && !webDAVPath.equals(rootPath)) {			upBean = new WebDAVBean();			upBean.setIconTheme(iconTheme);			int lastIndex = webDAVPath.lastIndexOf("/");			String upTo = ContentBlock.getBundle().getLocalizedString("up_to_parent_folder");			if (lastIndex > 0) {				String dotdot = webDAVPath.substring(0, lastIndex);				int lastIndex2 = dotdot.lastIndexOf("/");				if (lastIndex2 > -1) {										upBean.setName(upTo+" ("+dotdot.substring(lastIndex2+1)+")");				} else {					upBean.setName(upTo+" ("+dotdot+")");				}				upBean.setWebDavHttpURL(dotdot);			} else {				upBean.setName(upTo);				upBean.setWebDavHttpURL("");			}			upBean.setIsReal(false);			upBean.setIsCollection(true);		}				while (enumer.hasMoreElements()) {			resource = (WebdavExtendedResource) enumer.nextElement();			if (!resource.getDisplayName().startsWith(".")) {				if (showFolders || (!showFolders && !resource.isCollection())) {					bean = new WebDAVBean(resource);					url = resource.getPath();					url = url.replaceFirst(webDAVServletURL, "");					bean.setWebDavHttpURL(url);					bean.setIconTheme(iconTheme);					v.add(bean);				}			}		}				sortResources(v);		if (upBean != null) {			v.add(0,upBean);		}		return (WebDAVBean[]) v.toArray(new WebDAVBean[]{});	}