Package org.exoplatform.common.http.client

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


    * @throws IOException
    * @throws ModuleException
    */
   public HTTPResponse addDir(String path) throws IOException, ModuleException
   {
      HTTPResponse mkCol = MkCol(workspacePath + path);
      mkCol.getStatusCode();
      return mkCol;
   }
View Full Code Here


   public HTTPResponse restore(String node, String version) throws IOException, ModuleException
   {
      NVPair[] query = new NVPair[1];
      query[0] = new NVPair("version", version);

      HTTPResponse response = Get(workspacePath + node, query);
      response.getStatusCode();

      return response;
   }
View Full Code Here

      headers[0] =
         new NVPair(ExtHttpHeaders.DESTINATION, this.getProtocol() + "://" + this.getHost() + ":" + this.getPort()
            + workspacePath + destination);
      headers[1] = new NVPair(HttpHeaders.CONTENT_LENGTH, Integer.toString("".length()));

      HTTPResponse response = ExtensionMethod("MOVE", workspacePath + path, "".getBytes(), headers);
      response.getStatusCode();

      return response;
   }
View Full Code Here

      NVPair[] headers = new NVPair[2];
      headers[0] = new NVPair(HttpHeaders.CONTENT_TYPE, "text/xml; charset='utf-8'");
      headers[1] = new NVPair(HttpHeaders.CONTENT_LENGTH, Integer.toString(xmlBody.length()));

      HTTPResponse response = ExtensionMethod("SEARCH", workspacePath, xmlBody.getBytes(), headers);
      response.getStatusCode();

      return response;
   }
View Full Code Here

      NVPair[] headers = new NVPair[2];
      headers[0] = new NVPair(HttpHeaders.CONTENT_TYPE, "text/xml; charset='utf-8'");
      headers[1] = new NVPair(HttpHeaders.CONTENT_LENGTH, Integer.toString(xmlBody.length()));

      HTTPResponse response = ExtensionMethod("SEARCH", workspacePath, xmlBody.getBytes(), headers);
      response.getStatusCode();

      return response;
   }
View Full Code Here

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

         connection.addBasicAuthorization(BaseTestCaseChecker.TEST_REALM, login, password);

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

         // print the status and response
         if (resp.getStatusCode() != 200)
            System.out.println(resp.getStatusCode() + "\n" + resp.getText());

         result = resp.getText();
      }
      catch (Exception e)
      {
         e.printStackTrace();
      }
View Full Code Here

            testConfig.setUserPass(userPass);

            HTTPConnection connection = WebDavUtils.getAuthConnection(testConfig);

            String filePath = WebDavUtils.getFullPath(testConfig);
            HTTPResponse response = connection.Head(filePath);

            LOG.info("Testing connection....");

            int status = response.getStatusCode();

            if (status == HTTPStatus.OK)
            {
               showMessageBox("Connection successful!");
               return;
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

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.