throw ServiceException.FAILURE("url must begin with http: or https:", null);
throw ServiceException.INVALID_REQUEST("url must begin with http: or https:", null);
    public static SubscriptionData retrieveRemoteDatasource(Account acct, String url, Folder.SyncData fsd) throws ServiceException {        HttpClient client = new HttpClient();        client.setConnectionTimeout(10000);        client.setTimeout(20000);        BufferedInputStream content = null;        try {            int redirects = 0;            do {                if (url == null || url.equals(""))                    return new SubscriptionData();                String lcurl = url.toLowerCase();                if (lcurl.startsWith("webcal:"))                    url = "http:" + url.substring(7);                else if (lcurl.startsWith("feed:"))                    url = "http:" + url.substring(5);                else if (!lcurl.startsWith("http:") && !lcurl.startsWith("https:"))                    throw ServiceException.FAILURE("url must begin with http: or https:", null);                GetMethod get = new GetMethod(url);                get.setFollowRedirects(true);                get.addRequestHeader("User-Agent", HTTP_USER_AGENT);                get.addRequestHeader("Accept", HTTP_ACCEPT);                client.executeMethod(get);                Header locationHeader = get.getResponseHeader("location");                if (locationHeader == null) {                    content = new BufferedInputStream(get.getResponseBodyAsStream());                    break;                }                url = locationHeader.getValue();            } while (++redirects <= MAX_REDIRECTS);            if (redirects > MAX_REDIRECTS)                throw ServiceException.TOO_MANY_HOPS();            switch (getLeadingChar(content)) {                case -1:                    throw ServiceException.PARSE_ERROR("empty body in response when fetching remote subscription", null);                case '<':                    return parseRssFeed(Element.parseXML(content), fsd);                case 'B':  case 'b':                    Reader reader = new InputStreamReader(content);                    ZVCalendar ical = ZCalendarBuilder.build(reader);                    return new SubscriptionData(Invite.createFromCalendar(acct, null, ical, false));                default:                    throw ServiceException.PARSE_ERROR("unrecognized remote content", null);            }        } catch (org.dom4j.DocumentException e) {            throw ServiceException.PARSE_ERROR("could not parse feed", e);        } catch (HttpException e) {            throw ServiceException.RESOURCE_UNREACHABLE("HttpException: " + e, e);        } catch (IOException e) {            throw ServiceException.RESOURCE_UNREACHABLE("IOException: " + e, e);        }    }