org.japtproxy.fetcher
Class FetchedResourceFtp

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

public class FetchedResourceFtp
extends java.lang.Object
implements FetchedResource

The FetchedResourceFtp provides access to the via FTP fetched resource.

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

Constructor Summary
FetchedResourceFtp(org.apache.commons.net.ftp.FTPClient ftpClient, org.apache.commons.net.ftp.FTPFile file)
          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

FetchedResourceFtp

public FetchedResourceFtp(org.apache.commons.net.ftp.FTPClient ftpClient,
                          org.apache.commons.net.ftp.FTPFile file)
Constructor.

Parameters:
ftpClient - the FTPClient to use.
file - the referenced file.
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.