Package org.apache.util

Examples of org.apache.util.HttpURL


        this.password = password;
        this.protocol = protocol;
       
        this.systemId = "http://" + location;
       
        HttpURL httpURL = new HttpURL(this.systemId);
        httpURL.setUserInfo(principal, password);
       
        if (createNew) {
            this.resource = new WebdavResource(httpURL,
                WebdavResource.NOACTION,
                DepthSupport.DEPTH_1);
View Full Code Here


      this.systemId = source.getHttpURL().getURI();

      //fix trailing slash
        if (this.resource.isCollection() && (this.systemId.endsWith("/") == false)) {
            this.systemId = this.systemId+"/";
            HttpURL httpURL = new HttpURL(this.systemId);
            this.resource.setHttpURL(httpURL);
        }
    }
View Full Code Here

    public void setSourceCredential(SourceCredential sourcecredential)
        throws SourceException {
        this.sourcecredential = sourcecredential;
        if (sourcecredential == null) return;
        try {
            HttpURL httpURL = new HttpURL(this.systemId);
            httpURL.setUserInfo(
                sourcecredential.getPrincipal(),
                sourcecredential.getPassword());
            this.resource = new WebdavResource(httpURL);
        } catch (HttpException he) {
            throw new SourceException("Could not set credentials", he);
View Full Code Here

     *
     * @return true if the given httpURL is the client for this resource.
     */
    private synchronized boolean isTheClient() throws MalformedURLException {
       
        HttpURL clientHttpURL =
            new HttpURL(client.getUserName(), client.getPassword(),
                        client.getHost(), client.getPort());
       
        return clientHttpURL.getAuthority().equals(httpURL.getAuthority());
    }
View Full Code Here

     */
    public void setHttpURL
        (HttpURL httpURL, String additionalPath, int action, int depth)
        throws HttpException, IOException {

        setHttpURL(new HttpURL(httpURL, additionalPath), action, depth);
    }
View Full Code Here

     */
    public void setHttpURL
        (HttpURL httpURL, String additionalPath, int action)
        throws HttpException, IOException {

        setHttpURL(new HttpURL(httpURL, additionalPath), action, defaultDepth);
    }
View Full Code Here

     * @see #setPath(java.lang.String)
     */
    public void setHttpURL(HttpURL httpURL, String additionalPath)
        throws HttpException, IOException {

        setHttpURL(new HttpURL(httpURL, additionalPath),
                   defaultAction, defaultDepth);
    }
View Full Code Here

     * @see #setPath(java.lang.String)
     */
    public void setHttpURL(String escapedHttpURL)
        throws HttpException, IOException {

        setHttpURL(new HttpURL(escapedHttpURL));
    }
View Full Code Here

     * @return the value 0 if the argument is equal.
     */
    public int compareToWebdavResource(WebdavResource another) {

        try {
            HttpURL anotherUrl = another.getHttpURL();

            String thisHost = httpURL.getHost();
            String anotherHost= anotherUrl.getHost();
            if (!thisHost.equalsIgnoreCase(anotherHost))
                return thisHost.compareTo(anotherHost);

            int thisPort = httpURL.getPort();
            int anotherPort= anotherUrl.getPort();
            if (thisPort != anotherPort)
                return (thisPort < anotherPort) ? -1 : 1;

            boolean thisCollection = isCollection();
            boolean anotherCollection = another.isCollection();
            if (thisCollection && !anotherCollection)
                return -1;
            if (anotherCollection && !thisCollection)
                return 1;

            String thisPath = httpURL.getPathQuery();
            String anotherPath= anotherUrl.getPathQuery();
            return thisPath.compareTo(anotherPath);
        } catch (Exception e) {
            // FIXME: not to return 0.
        }

View Full Code Here

     *
     * @return true if the given httpURL is the client for this resource.
     */
    private synchronized boolean isTheClient() throws MalformedURLException {
       
        HttpURL clientHttpURL =
            new HttpURL(client.getUserName(), client.getPassword(),
                        client.getHost(), client.getPort());
       
        return clientHttpURL.getAuthority().equals(httpURL.getAuthority());
    }
View Full Code Here

TOP

Related Classes of org.apache.util.HttpURL

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.