Examples of IHTTPConnection


Examples of org.tmatesoft.svn.core.internal.io.dav.http.IHTTPConnection

            String locationPath = getLocation().getPath();
            locationPath = SVNEncodingUtil.uriEncode(locationPath);
            request = DAVMergeHandler.generateLockDataRequest(request, locationPath, repositoryPath, myLocks);
        }
       
        IHTTPConnection httpConnection = getConnection();
        HTTPStatus status = httpConnection.request("DELETE", path, header, request, 204, 0, null, null);
        if (status.getError() != null) {
            SVNErrorCode errCode = status.getError().getErrorCode();
            if (errCode == SVNErrorCode.FS_BAD_LOCK_TOKEN || errCode == SVNErrorCode.FS_NO_LOCK_TOKEN ||
                    errCode == SVNErrorCode.FS_LOCK_OWNER_MISMATCH || errCode == SVNErrorCode.FS_PATH_ALREADY_LOCKED) {
                Map childTokens = null;
                if (myLocks != null) {
                    childTokens = new SVNHashMap();
                    for (Iterator locksIter = myLocks.keySet().iterator(); locksIter.hasNext();) {
                        String lockPath = (String) locksIter.next();
                        if (lockPath.startsWith(path)) {
                            childTokens.put(lockPath, myLocks.get(lockPath));
                        }
                    }
                }
               
                if (childTokens == null || childTokens.isEmpty()) {
                    SVNErrorManager.error(status.getError(), SVNLogType.NETWORK);
                } else {
                    status.setError(null);
                }
               
                String token = myLocks != null ? (String) myLocks.get(path) : null;
                if (token != null) {
                    childTokens.put(path, token);
                }
               
                request = new StringBuffer();
                String locationPath = getLocation().getPath();
                locationPath = SVNEncodingUtil.uriEncode(locationPath);
               
                request = DAVMergeHandler.generateLockDataRequest(request, locationPath, repositoryPath, childTokens);
                HTTPStatus status2 = httpConnection.request("DELETE", path, header, request, 204, 404, null, null);
                if (status2.getError() != null) {
                    SVNErrorManager.error(status2.getError(), SVNLogType.NETWORK);
                }
                return status2;
            }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.dav.http.IHTTPConnection

       
        return status;
    }

    public HTTPStatus doMakeCollection(String path) throws SVNException {
        IHTTPConnection httpConnection = getConnection();
        return httpConnection.request("MKCOL", path, null, (StringBuffer) null, 201, 0, null, null);
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.dav.http.IHTTPConnection

            headers.setHeaderValue(HTTPHeader.BASE_MD5, baseChecksum);
        }
        if (textChecksum != null) {
            headers.setHeaderValue(HTTPHeader.TEXT_MD5, textChecksum);
        }
        IHTTPConnection httpConnection = getConnection();
        return httpConnection.request("PUT", path, headers, data, 201, 204, null, null);
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.dav.http.IHTTPConnection

            if (myLocks != null && !myKeepLocks) {
                value += " release-locks";
            }
            header.setHeaderValue(HTTPHeader.SVN_OPTIONS_HEADER, value);
        }
        IHTTPConnection httpConnection = getConnection();
        return httpConnection.request("MERGE", getLocation().getURIEncodedPath(), header, request, -1, 0, null, handler);
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.dav.http.IHTTPConnection

        if (myLocks != null && repositoryPath != null && myLocks.containsKey(repositoryPath)) {
            header = new HTTPHeader();
            header.setHeaderValue(HTTPHeader.IF_HEADER, "(<" + myLocks.get(repositoryPath) + ">)");
        }
       
        IHTTPConnection httpConnection = getConnection();
        HTTPStatus status = httpConnection.request("CHECKOUT", path, header, request, 201, allow404 ? 404 : 0,
                null, null);
        if (allow404 && status.getCode() == 404 && status.getError() != null) {
            status.setError(null);
        }
        // update location to be a path!
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.dav.http.IHTTPConnection

    public void doCopy(String src, String dst, int depth) throws SVNException {
        HTTPHeader header = new HTTPHeader();
        header.setHeaderValue(HTTPHeader.DESTINATION_HEADER, dst);
        header.setHeaderValue(HTTPHeader.DEPTH_HEADER, depth > 0 ? "infinity" : "0");
        SVNErrorMessage context = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "COPY of {0}", src);
        IHTTPConnection httpConnection = getConnection();
        HTTPStatus status = httpConnection.request("COPY", src, header, (StringBuffer) null, -1, 0, null, null, context);
        if (status.getCode() >= 300 && status.getError() != null) {
            SVNErrorMessage err = status.getError();
            SVNErrorManager.error(err, SVNLogType.NETWORK);
        }       
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.dav.http.IHTTPConnection

        return myHttpConnection;
    }

    protected void exchangeCapabilities() throws SVNException {
        String path = SVNEncodingUtil.uriEncode(getLocation().getPath());
        IHTTPConnection httpConnection = getConnection();
        HTTPStatus status = httpConnection.request("OPTIONS", path, null, (StringBuffer) null, 200, 0, null, null);
        if (status.getCode() == 200) {
          parseCapabilities(status);
        } else {
          SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_OPTIONS_REQ_FAILED,
              "OPTIONS request (for capabilities) got HTTP response code {0}",
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.dav.http.IHTTPConnection

    private String getActivityCollectionURL(String path, boolean force) throws SVNException {
        if (!force && myActivityCollectionURL != null) {
            return myActivityCollectionURL;
        }
        DAVOptionsHandler handler = new DAVOptionsHandler();
        IHTTPConnection httpConnection = getConnection();
        httpConnection.request("OPTIONS", path, null, DAVOptionsHandler.OPTIONS_REQUEST, -1, 0, null, handler);
        myActivityCollectionURL = handler.getActivityCollectionURL();
        if (myActivityCollectionURL == null) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_OPTIONS_REQ_FAILED,
                    "The OPTIONS request did not include the requested activity-collection-set; this often means that the URL is not WebDAV-enabled");
            SVNErrorManager.error(err, SVNLogType.NETWORK);
View Full Code Here

Examples of org.xlightweb.IHttpConnection

   
   
    public void sendError(int errorCode, String msg) throws IllegalStateException {
      try {
        String id = "";
        IHttpConnection connection = getConnection();
        if (connection != null) {
          id = connection.getId();
        }
        send(new HttpResponse(errorCode, "text/html", HttpClientConnection.generateErrorMessageHtml(errorCode, msg, id)));
      } catch (IOException ioe) {
        if (LOG.isLoggable(Level.FINE)) {
          LOG.fine("could not send error message " + errorCode + " reason " + ioe.toString());
View Full Code Here

Examples of org.xlightweb.IHttpConnection

      request.setHeader("Connection", "upgrade");
      request.setHeader("Origin", "http://websockets.org:" + server.getLocalPort());

      IHttpResponse response = client.call(request);
     
      IHttpConnection con = (IHttpConnection) response.getAttribute("org.xlightweb.client.connection");
      Assert.assertTrue(con.isOpen());
           
      client.close();
      server.close();
  }
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.