org.japtproxy.fetcher
Class FetchedResourceHttp

java.lang.Object
  extended by org.japtproxy.fetcher.FetchedResourceHttp
All Implemented Interfaces:
FetchedResource

public class FetchedResourceHttp
extends java.lang.Object
implements FetchedResource

The FetchedResourceHttp provides access to the via HTTP fetched resource.

Version:
$LastChangedRevision:79 $
Author:
Oliver J. Siegmar

Constructor Summary
FetchedResourceHttp(org.apache.commons.httpclient.methods.GetMethod httpGet)
          Constructor.
 
Method Summary
 void close()
          Closes open fetcher connection.
 long getContentLength()
          
 java.lang.String getContentType()
          
 java.io.InputStream getInputStream()
          
 long getLastModified()
          
 boolean isModified()
          
 void setModified(boolean modified)
          Sets the modified field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FetchedResourceHttp

public FetchedResourceHttp(org.apache.commons.httpclient.methods.GetMethod httpGet)
Constructor.

Parameters:
httpGet - the GetMethod instance.
Method Detail

isModified

public boolean isModified()

Specified by:
isModified in interface FetchedResource
Returns:
Returns if the resource has been modified.

setModified

public void setModified(boolean modified)
Sets the modified field.

Parameters:
modified - the modified field.

getContentType

public java.lang.String getContentType()

Specified by:
getContentType in interface FetchedResource
Returns:
Returns the contentType (aka mime type).

getLastModified

public long getLastModified()

Specified by:
getLastModified in interface FetchedResource
Returns:
Returns the timestamp of the last modification.

getContentLength

public long getContentLength()

Specified by:
getContentLength in interface FetchedResource
Returns:
Returns the length of the content.

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException

Specified by:
getInputStream in interface FetchedResource
Returns:
Returns the InputStream.
Throws:
java.io.IOException - is thrown if the operation fails.

close

public void close()
Closes open fetcher connection.

Specified by:
close in interface FetchedResource


Copyright © 2006-2008. All Rights Reserved.