return URLUtil.getMailURL(prov.getLocalServer(), buf.toString(), true);
String url = URLUtil.getMailURL(prov.getLocalServer(), buf.toString(), true); if (url.startsWith("https")) url = new HttpsURL(url).toString(); else url = new HttpURL(url).toString(); return url; } catch (IOException e) { throw new DavException("cannot create URL for user "+user, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e);
	public static String getHomeUrl(String user) throws DavException {		StringBuilder buf = new StringBuilder();		buf.append(DAV_PATH).append("/").append(user);		try {			Provisioning prov = Provisioning.getInstance();			return URLUtil.getMailURL(prov.getLocalServer(), buf.toString(), true);		} catch (ServiceException e) {			throw new DavException("cannot create URL for user "+user, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e);		}	}