Package org.exoplatform.common.http.client

Examples of org.exoplatform.common.http.client.HTTPResponse


         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)
      {
         throw new BackupExecuteException(e.getMessage(), e);
View Full Code Here


         Throwable e = new Throwable("Necessary URL parameter not found in proxy request");
         throw new WebApplicationException(e, createErrorResponse(e, 404));
      }
      try
      {
         HTTPResponse resp = conn.fetchGet(httpRequest, url);
         return createResponse(resp);
      }
      catch (MalformedURLException mue)
      {
         throw new WebApplicationException(mue, createErrorResponse(mue, 400));
View Full Code Here

         Throwable e = new Throwable("Necessary URL parameter not found in proxy request");
         throw new WebApplicationException(e, createErrorResponse(e, 404));
      }
      try
      {
         HTTPResponse resp = conn.fetchPost(httpRequest, url);
         return createResponse(resp);
      }
      catch (MalformedURLException mue)
      {
         throw new WebApplicationException(mue, createErrorResponse(mue, 400));
View Full Code Here

         Throwable e = new Throwable("Necessary URL parameter not found in proxy request");
         throw new WebApplicationException(e, createErrorResponse(e, 404));
      }
      try
      {
         HTTPResponse resp = conn.doPut(httpRequest, url);
         return createResponse(resp);
      }
      catch (MalformedURLException mue)
      {
         throw new WebApplicationException(mue, createErrorResponse(mue, 400));
View Full Code Here

         Throwable e = new Throwable("Necessary URL parameter not found in proxy request");
         throw new WebApplicationException(e, createErrorResponse(e, 404));
      }
      try
      {
         HTTPResponse resp = conn.doDelete(httpRequest, url);
         return createResponse(resp);
      }
      catch (MalformedURLException mue)
      {
         throw new WebApplicationException(mue, createErrorResponse(mue, 400));
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);

         if (resp.getStatusCode() != HTTP_OK)
            throw new RemoteWorkspaceInitializationException("Fail remote initializetion : " + result);

      }
      catch (ModuleException e)
      {
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);

         return realm;
View Full Code Here

      addBasicAuthorization(this.realm, this.user, this.pass);
   }

   public HTTPResponse addNode(String name, byte[] data) throws IOException, ModuleException
   {
      HTTPResponse response = Put(workspacePath + name, data);
      response.getStatusCode();
      return response;
   }
View Full Code Here

         mixins = mixins + ", " + mixinTypes[i];
      }
      NVPair[] headers = new NVPair[2];
      headers[0] = new NVPair(ExtHttpHeaders.CONTENT_MIXINTYPES, mixins);
      headers[1] = new NVPair(HttpHeaders.CONTENT_TYPE, "text/plain");
      HTTPResponse response = Put(workspacePath + name, data, headers);
      response.getStatusCode();
      return response;
   }
View Full Code Here

    */
   public HTTPResponse addNode(String name, byte[] data, String mimeType) throws IOException, ModuleException
   {
      NVPair[] headers = new NVPair[1];
      headers[0] = new NVPair(HttpHeaders.CONTENT_TYPE, mimeType);
      HTTPResponse response = Put(workspacePath + name, data, headers);
      response.getStatusCode();
      return response;
   }
View Full Code Here

TOP

Related Classes of org.exoplatform.common.http.client.HTTPResponse

Copyright © 2018 www.massapicom. 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.