Examples of HttpURL


Examples of com.sun.midp.io.HttpUrl

     */
    protected void checkForDifferentDomains(String url) {
        String previousUrl = state.previousInstallInfo.getDownloadUrl();
        // perform a domain check not a straight compare
        if (info.authPath == null && previousUrl != null) {
            HttpUrl old = new HttpUrl(previousUrl);
            HttpUrl current = new HttpUrl(url);

            if ((current.domain != null && old.domain == null) ||
                (current.domain == null && old.domain != null) ||
                (current.domain != null && old.domain != null &&
                 !current.domain.regionMatches(true, 0, old.domain, 0,
View Full Code Here

Examples of com.worldpay.protocols.http.HTTPURL

            }
        }

        // create the purchase link
        String purchaseURL = null;
        HTTPURL link = null;
        URLParameters linkParms = null;
        try {
            purchaseURL = Select.getPurchaseURL();
            link = new HTTPURL(purchaseURL);
            linkParms = link.getParameters();
        } catch (SelectException e) {
            Debug.logError(e, "Problems creating the purchase url", module);
            request.setAttribute("_ERROR_MESSAGE_", "<li>Problem creating link to WorldPay, please contact customer service.");
            return "error";
        } catch (ArgumentException e) {
            Debug.logError(e, "Problems creating HTTPURL link", module);
            request.setAttribute("_ERROR_MESSAGE_", "<li>Problem creating link to WorldPay, please contact customer service.");
            return "error";
        }

        // create the currency amount
        double orderTotal = orderHeader.getDouble("grandTotal").doubleValue();
        CurrencyAmount currencyAmount = null;
        try {
            Currency currency = SelectCurrency.getInstanceByISOCode(defCur);
            currencyAmount = new CurrencyAmount(orderTotal, currency);
        } catch (ArgumentException ae) {
            Debug.logError(ae, "Problems building CurrencyAmount", module);
            request.setAttribute("_ERROR_MESSAGE_", "<li>Merchant Configuration Error, please contact customer service.");
            return "error";
        }

        // create a purchase token
        PurchaseToken token = null;
        try {
            token = new PurchaseToken(instIdInt, currencyAmount, orderId);
        } catch (SelectException e) {
            Debug.logError(e, "Cannot create purchase token", module);
        } catch (ArgumentException e) {
            Debug.logError(e, "Cannot create purchase token", module);
        }
        if (token == null) {
            request.setAttribute("_ERROR_MESSAGE_", "<li>Problems creating a purchase token, please contact customer service.");
            return "error";
        }

        // set the auth/test modes
        try {
            token.setAuthorisationMode(authMode);
        } catch (SelectException e) {
            Debug.logWarning(e, "Problems setting the authorization mode", module);
        }
        token.setTestMode(testModeInt);

        // set the token to the purchase link
        try {
            linkParms.setValue(SelectDefs.SEL_purchase, token.produce());
        } catch (SelectException e) {
            Debug.logError(e, "Problems producing token", module);
            request.setAttribute("_ERROR_MESSAGE_", "<li>Problems producing purchase token, please contact customer service.");
            return "error";
        }

        // set the customer data in the link
        linkParms.setValue(SelectDefs.SEL_desc, description);
        linkParms.setValue(SelectDefs.SEL_name, name != null ? name : "");
        linkParms.setValue(SelectDefs.SEL_address, address != null ? address.toString() : "");
        linkParms.setValue(SelectDefs.SEL_postcode, contactAddress != null ? contactAddress.getString("postalCode") : "");
        linkParms.setValue(SelectDefs.SEL_country, countryGeo.getString("geoCode"));
        linkParms.setValue(SelectDefs.SEL_tel, phoneNumber != null ? phoneNumber : "");
        linkParms.setValue(SelectDefs.SEL_email, emailAddress != null ? emailAddress : "");

        // set some optional data
        if (fixContact != null && fixContact.toUpperCase().startsWith("Y")) {
            linkParms.setValue(SelectDefs.SEL_fixContact, "Y");
        }
        if (hideContact != null && hideContact.toUpperCase().startsWith("Y")) {
            linkParms.setValue("hideContact", "Y"); // why is this not in SelectDefs??
        }

        // now set some send-back parameters
        linkParms.setValue("M_controlPath", (String)request.getAttribute("_CONTROL_PATH_"));
        linkParms.setValue("M_userLoginId", userLogin.getString("userLoginId"));
        linkParms.setValue("M_dispatchName", dispatcher.getName());
        linkParms.setValue("M_delegatorName", delegator.getDelegatorName());
        linkParms.setValue("M_webSiteId", webSiteId);
        linkParms.setValue("M_localLocale", UtilHttp.getLocale(request).toString());
        linkParms.setValue("M_confirmTemplate", confirmTemplate != null ? confirmTemplate : "");

        // redirect to worldpay
        try {
            response.sendRedirect(link.produce());
        } catch (IOException e) {
            Debug.logError(e, "Problems redirecting to Worldpay", module);
            request.setAttribute("_ERROR_MESSAGE_", "<li>Problems connecting with WorldPay, please contact customer service.");
            return "error";
        }
View Full Code Here

Examples of org.apache.commons.httpclient.HttpURL

    {
        // Create an Http client
        HttpClient client;
        try
        {
            final HttpURL url = new HttpURL(username,
                password,
                hostname,
                port,
                "/");
View Full Code Here

Examples of org.apache.commons.httpclient.HttpURL

        if (resource == null)
        {
            // HttpURL url = new HttpURL(name.getHostName(), name.getPort(), name.getPath());
            String pathEncoded = name.getPathQueryEncoded(urlCharset);
            HttpURL url = new HttpURL(name.getUserName(), name.getPassword(), name.getHostName(), name.getPort());
            url.setEscapedPath(pathEncoded);
            resource = new WebdavResource(fileSystem.getClient())
            {
            };
            resource.setHttpURL(url, WebdavResource.NOACTION, 1);
        }
View Full Code Here

Examples of org.apache.commons.httpclient.HttpURL

    private static int lockDAVMinutes = 240;

    public HttpDocument(String url, String user, String pass) {
        this.url = url;
        try {
            httpURL = new HttpURL(url);
            if (user == null || user.length() == 0)
                user = httpURL.getUser();
            if (pass == null || pass.length() == 0)
                pass = httpURL.getPassword();
            if (user != null)
View Full Code Here

Examples of org.apache.commons.httpclient.HttpURL

        if (res.exists()) {
            return (!res.isCollection());
        } else {
            try {
                HttpURL parentURL = new HttpURL(httpURL.toString());
                String user = httpURL.getUser();
                String pass = httpURL.getPassword();
                if (user != null)
                    parentURL.setUserinfo(user, pass);
                String currentHierPath = httpURL.getCurrentHierPath();
                if (!currentHierPath.endsWith("/"))
                    currentHierPath = currentHierPath + "/";
                parentURL.setPath(currentHierPath);
                WebdavResource parentRes = new WebdavResource(parentURL);
                if (!parentRes.isCollection())
                    return false;
                return true;
            } catch (Exception e) {
View Full Code Here

Examples of org.apache.commons.httpclient.HttpURL

        //shell.dispose();
        password = getPassword()
      }


      HttpURL hrl = new HttpURL(url);     

      hrl.setUserinfo(user,password);
      if(proxyHost.length() > 0)
        wdr = new WebdavResource(hrl, proxyHost, proxyPort);
      else
        wdr = new WebdavResource(hrl);
View Full Code Here

Examples of org.apache.commons.httpclient.HttpURL

        if (name.contains("/")) {
            throw new ContentRepositoryException("Paths not allowed: " + name);
        }

        try {
            HttpURL url = getChildURL(getResource().getHttpURL(), name);
           
            logger.fine("[WebdavContentCollection] Get child " + name +
                        " returns " + url + " from " + this);

            AuthenticatedWebdavResource resource =
View Full Code Here

Examples of org.apache.commons.httpclient.HttpURL

        if (name.contains("/")) {
            throw new ContentRepositoryException("Paths not allowed: " + name);
        }

        try {
            HttpURL newURL = getChildURL(getResource().getHttpURL(), name);

            logger.fine("[WebdavContentCollection] Create child " + name +
                        " returns " + newURL + " from " + this);

            AuthenticatedWebdavResource newResource =
View Full Code Here

Examples of org.apache.commons.httpclient.HttpURL

        if (name.contains("/")) {
            throw new ContentRepositoryException("Paths not allowed: " + name);
        }

        try {
            HttpURL removeURL = getChildURL(getResource().getHttpURL(), name);
            AuthenticatedWebdavResource removeResource =
                    new AuthenticatedWebdavResource(getResource(), removeURL);
            if (removeResource.exists()) {
                removeResource.deleteMethod();
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.