Package org.exoplatform.common.http.client

Examples of org.exoplatform.common.http.client.HTTPConnection.Get()


         URL url = new URL(sUrl);
         HTTPConnection connection = new HTTPConnection(url);
         connection.removeModule(CookieModule.class);
         AuthorizationInfo.setAuthHandler(null);

         HTTPResponse resp = connection.Get(url.getFile());

         String authHeader = resp.getHeader("WWW-Authenticate");

         String realm = authHeader.split("=")[1];
         realm = realm.substring(1, realm.length() - 1);
View Full Code Here


         HTTPConnection connection = new HTTPConnection(url);
         connection.removeModule(CookieModule.class);

         connection.addBasicAuthorization(getRealm(complURL), login, password);

         HTTPResponse resp = connection.Get(url.getFile());

         BackupAgentResponse responce = new BackupAgentResponse(resp.getData(), resp.getStatusCode());
         return responce;
      }
      catch (ModuleException e)
View Full Code Here

         connection.removeModule(CookieModule.class);

         String realmName = getRealm(complURL);
         connection.addBasicAuthorization(realmName, userName, password);

         HTTPResponse resp = connection.Get(url.getFile());

         result = resp.getText();

         AuthorizationInfo.removeAuthorization(url.getHost(), url.getPort(), "Basic", realmName);
View Full Code Here

         URL url = new URL(sUrl);
         HTTPConnection connection = new HTTPConnection(url);
         connection.removeModule(CookieModule.class);
         AuthorizationInfo.setAuthHandler(null);

         HTTPResponse resp = connection.Get(url.getFile());

         String authHeader = resp.getHeader("WWW-Authenticate");

         String realm = authHeader.split("=")[1];
         realm = realm.substring(1, realm.length() - 1);
View Full Code Here

         NVPair credentials = getCredentials(url);
         if (credentials != null)
         {
            conn.addBasicAuthorization(null, credentials.getName(), credentials.getValue());
         }
         HTTPResponse resp = conn.Get(url.getFile(), (NVPair[])null, headerPairs);
         if (resp.getStatusCode() >= 300)
         {
            if (LOG.isDebugEnabled())
            {
               // Do not read data if debug is off.
View Full Code Here

         NVPair credentials = getCredentials(url);
         if (credentials != null)
         {
            conn.addBasicAuthorization(null, credentials.getName(), credentials.getValue());
         }
         HTTPResponse resp = conn.Get(url.getFile(), (NVPair[])null, headerPairs);
         if (resp.getStatusCode() >= 300)
         {
            if (LOG.isDebugEnabled())
            {
               // Do not read data if debug is off.
View Full Code Here

         URL url = new URL(sUrl);
         HTTPConnection connection = new HTTPConnection(url);
         connection.removeModule(CookieModule.class);
         AuthorizationInfo.setAuthHandler(null);

         HTTPResponse resp = connection.Get(url.getFile());

         String authHeader = resp.getHeader("WWW-Authenticate");
         if (authHeader == null)
         {
            return null;
View Full Code Here

            {
               respLogin = connectionLogin.Post(urlLogin.getFile(), formParams);
            }
            else
            {
               respLogin = connectionLogin.Get(urlLogin.getFile(), formParams);
            }

            if (Response.Status.OK.getStatusCode() != respLogin.getStatusCode())
            {
               System.out.println("Form authentication is fail, status code : " + respLogin.getStatusCode()); //NOSONAR
View Full Code Here

            {
               respLogin = connectionLogin.Post(urlLogin.getFile(), formParams);
            }
            else
            {
               respLogin = connectionLogin.Get(urlLogin.getFile(), formParams);
            }

            if (Response.Status.OK.getStatusCode() != respLogin.getStatusCode())
            {
               System.out.println("Form authentication is fail, status code : " + respLogin.getStatusCode()); //NOSONAR
View Full Code Here

      {
         resourcePath = "/" + resourcePath;
      }

      HTTPConnection connection = WebDavUtils.getAuthConnection(config);
      HTTPResponse response = connection.Get(href);

      int status = response.getStatusCode();

      if (status != HTTPStatus.OK)
      {
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.