ccc.api.http
Class SiteBrowserImpl

java.lang.Object
  extended by ccc.api.http.SiteBrowserImpl
All Implemented Interfaces:
SiteBrowser

public class SiteBrowserImpl
extends java.lang.Object
implements SiteBrowser

A simple HTTP implementation of the site browser API.

Author:
Civic Computing Ltd.

Constructor Summary
SiteBrowserImpl(org.apache.commons.httpclient.HttpClient httpClient, java.lang.String hostUrl)
          Constructor.
 
Method Summary
 java.lang.String get(java.lang.String absolutePath)
          Send an HTTP GET for a path.
 java.lang.String post(ResourceSummary rs)
          Send an HTTP post to a resource.
 java.lang.String previewContent(ResourceSummary rs, boolean wc)
          Preview how the specified resource will be rendered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SiteBrowserImpl

public SiteBrowserImpl(org.apache.commons.httpclient.HttpClient httpClient,
                       java.lang.String hostUrl)
Constructor.

Parameters:
httpClient - The HTTP client used to call the server.
hostUrl - The server's base URL.
Method Detail

previewContent

public java.lang.String previewContent(ResourceSummary rs,
                                       boolean wc)
Preview how the specified resource will be rendered.

Specified by:
previewContent in interface SiteBrowser
Parameters:
rs - The resource to render.
wc - True if the working copy should be rendered; false otherwise.
Returns:
The rendered resource as a String.

post

public java.lang.String post(ResourceSummary rs)
Send an HTTP post to a resource.

Specified by:
post in interface SiteBrowser
Parameters:
rs - The resource to request.
Returns:
The rendered resource as a String.

get

public java.lang.String get(java.lang.String absolutePath)
Send an HTTP GET for a path.

Specified by:
get in interface SiteBrowser
Returns:
The response body, as a string.


Copyright © 2010. All Rights Reserved.