Changeset 778

Show
Ignore:
Timestamp:
06/28/07 17:07:11 (2 years ago)
Author:
yuanying
Message:

Converter libraries are deleted. and dependency libraries are extracted.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • org.jalcedo.client/trunk/org.jalcedo.client.rest/.classpath

    r656 r778  
    22<classpath> 
    33    <classpathentry kind="src" path="src"/> 
    4     <classpathentry kind="src" path="json-src"/> 
    5     <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.0.4.jar"/> 
    6     <classpathentry exported="true" kind="lib" path="lib-http/commons-httpclient-3.0.1.jar"/> 
    7     <classpathentry exported="true" kind="lib" path="lib-http/commons-codec-1.3.jar"/> 
    8     <classpathentry exported="true" kind="lib" path="lib-json/ezmorph-1.0.1.jar"/> 
    9     <classpathentry exported="true" kind="lib" path="lib-json/commons-lang-2.2.jar"/> 
    10     <classpathentry exported="true" kind="lib" path="lib-json/commons-beanutils-1.7.0.jar"/> 
    114    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 
    125    <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> 
  • org.jalcedo.client/trunk/org.jalcedo.client.rest/META-INF/MANIFEST.MF

    r718 r778  
    66Bundle-Vendor: Jalcedo.org 
    77Bundle-Localization: plugin 
    8 Bundle-ClassPath: lib/commons-logging-1.0.4.jar, 
    9  lib-http/commons-httpclient-3.0.1.jar, 
    10  lib-http/commons-codec-1.3.jar, 
    11  lib-json/ezmorph-1.0.1.jar, 
    12  lib-json/commons-lang-2.2.jar, 
    13  lib-json/commons-beanutils-1.7.0.jar, 
    14  . 
    15 Export-Package: org.jalcedo.client.rest.convert, 
    16  org.jalcedo.client.rest.connect 
     8Bundle-ClassPath: . 
     9Export-Package: org.jalcedo.client.rest.connect 
     10Require-Bundle: org.apache.commons.httpclient, 
     11 org.apache.commons.logging 
  • org.jalcedo.client/trunk/org.jalcedo.client.rest/build.properties

    r718 r778  
    33output.. = bin/ 
    44bin.includes = META-INF/,\ 
    5                .,\ 
    6                lib/commons-logging-1.0.4.jar,\ 
    7                lib-http/commons-httpclient-3.0.1.jar,\ 
    8                lib-http/commons-codec-1.3.jar,\ 
    9                lib-json/ezmorph-1.0.1.jar,\ 
    10                lib-json/commons-lang-2.2.jar,\ 
    11                lib-json/commons-beanutils-1.7.0.jar 
     5               . 
    126src.includes = .classpath,\ 
    137               .project,\ 
  • org.jalcedo.client/trunk/org.jalcedo.client.rest/src/org/jalcedo/client/rest/connect/Connection.java

    r729 r778  
    3939     *  
    4040     * @param url 
     41     * @param queryParams 
    4142     * @param body 
    42      * @param queryParams 
    4343     * @return 
    4444     */ 
    45     Response put(String url, RequestEntity body, Map<String, String> queryParams) throws ConnectionException; 
     45    Response put(String url, Map<String, String> queryParams, RequestEntity body) throws ConnectionException; 
    4646     
    4747    /** 
    4848     *  
    4949     * @param url 
     50     * @param queryParams 
    5051     * @param body 
    51      * @param queryParams 
    5252     * @return 
    5353     */ 
    54     Response post(String url, RequestEntity body, Map<String, String> queryParams) throws ConnectionException; 
     54    Response post(String url, Map<String, String> queryParams, RequestEntity body) throws ConnectionException; 
    5555} 
  • org.jalcedo.client/trunk/org.jalcedo.client.rest/src/org/jalcedo/client/rest/connect/HttpClientConnection.java

    r729 r778  
    4949    protected final Log logger = LogFactory.getLog(this.getClass()); 
    5050     
     51    private HttpClient httpClient; 
     52     
     53    public HttpClientConnection() { 
     54         
     55    } 
     56     
     57    public HttpClientConnection(HttpClient httpClient) { 
     58        this.httpClient = httpClient; 
     59    } 
     60 
    5161    private boolean followRedirects = true; 
    5262 
     
    120130            URI redirectUri = this.extractRedirectURI(method); 
    121131            method.releaseConnection(); 
    122             return this.get(redirectUri.toString(), new HashMap<String, String>()); 
     132            return this.get(redirectUri.toString(), 
     133                    new HashMap<String, String>()); 
    123134        } 
    124135        return new HttpResponse(method); 
    125136    } 
    126      
     137 
    127138    /** 
    128139     *  
     
    150161    /** 
    151162     * this http method needs redirect. 
     163     *  
    152164     * @param method 
    153165     * @return 
     
    167179    /* 
    168180     * (non-Javadoc) 
    169      *  
    170      * @see org.jalcedo.client.rest.connect.Connection#post(java.lang.String, 
    171      *      org.jalcedo.client.rest.connect.RequestEntity, java.util.Map) 
    172      */ 
    173     public Response post(String url, RequestEntity body, 
    174             Map<String, String> queryParams) throws ConnectionException { 
     181     * @see org.jalcedo.client.rest.connect.Connection#post(java.lang.String, java.util.Map, org.jalcedo.client.rest.connect.RequestEntity) 
     182     */ 
     183    public Response post(String url, Map<String, String> queryParams, 
     184            RequestEntity body) throws ConnectionException { 
    175185        try { 
    176186            PostMethod method = new PostMethod(url); 
     
    186196     *  
    187197     * @see org.jalcedo.client.rest.connect.Connection#put(java.lang.String, 
    188      *      org.jalcedo.client.rest.connect.RequestEntity, java.util.Map
    189      */ 
    190     public Response put(String url, RequestEntity body
    191             Map<String, String> queryParams) throws ConnectionException { 
     198     *      java.util.Map, org.jalcedo.client.rest.connect.RequestEntity
     199     */ 
     200    public Response put(String url, Map<String, String> queryParams
     201            RequestEntity body) throws ConnectionException { 
    192202        try { 
    193203            PutMethod method = new PutMethod(url); 
     
    216226 
    217227    public HttpClient getHttpClient() { 
    218         return CLIENT; 
     228        if (this.httpClient == null) { 
     229            return CLIENT; 
     230        } 
     231        return this.httpClient; 
    219232    } 
    220233 
     
    314327        } 
    315328    } 
    316      
     329 
    317330    private class HttpResponse implements Response { 
    318          
     331 
    319332        final private HttpMethod method; 
    320          
     333 
    321334        public HttpResponse(HttpMethod method) { 
    322335            this.method = method; 
    323336        } 
    324337 
    325         public String getContentType() { 
     338        public String getMediaType() { 
    326339            return this.method.getResponseHeader("content-type").getValue(); 
    327340        } 
     
    334347            return this.method.getResponseBodyAsString(); 
    335348        } 
    336          
     349 
    337350    } 
    338351} 
  • org.jalcedo.client/trunk/org.jalcedo.client.rest/src/org/jalcedo/client/rest/connect/Response.java

    r729 r778  
    3434     * @return 
    3535     */ 
    36     String getContentType(); 
     36    String getMediaType(); 
    3737}