org.apache.oodt.product.handlers.ofsn
Class URLGetHandler

java.lang.Object
  extended by org.apache.oodt.product.handlers.ofsn.AbstractCrawlLister
      extended by org.apache.oodt.product.handlers.ofsn.URLGetHandler
All Implemented Interfaces:
OFSNGetHandler, OFSNListHandler

public class URLGetHandler
extends AbstractCrawlLister
implements OFSNGetHandler

A OFSNGetHandler for returning a URL listing pointing to files within an OFSN NOTE: Configuration parameters for this class include: 1. Server hostname 2. Server port 3. Webapp context-root 4. Path to product-root 5. Return type desired for URLs

Version:
$Revision$
Author:
rverma

Field Summary
protected static String DEFAULT_PROD_SERVER_CONTEXT
           
protected static String DEFAULT_PROD_SERVER_HOSTNAME
           
protected static String DEFAULT_PROD_SERVER_PORT
           
protected static String DEFAULT_PRODUCT_ROOT
           
protected static String DEFAULT_RETURN_TYPE
           
protected static String DEFAULT_RETURN_VALUE
           
 
Fields inherited from class org.apache.oodt.product.handlers.ofsn.AbstractCrawlLister
DIR_FILTER, FILE_FILTER
 
Constructor Summary
URLGetHandler()
           
 
Method Summary
 void configure(Properties prop)
          Configures this handler with the provided configuration stored in a Properties object.
 File[] getListing(String filePath)
          Handlers that implement this method take an Online File Specification Name and return back a listing of files on the remote server.
 byte[] retrieveChunk(String filepath, long offset, int length)
          Retrieves a chunk of data from the remote file.
 long sizeOf(String filepath)
          Returns the size of the remote data, which may be the entire file in question, or some subset/transformation on it.
 
Methods inherited from class org.apache.oodt.product.handlers.ofsn.AbstractCrawlLister
crawlFiles
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_RETURN_VALUE

protected static final String DEFAULT_RETURN_VALUE
See Also:
Constant Field Values

DEFAULT_PROD_SERVER_HOSTNAME

protected static final String DEFAULT_PROD_SERVER_HOSTNAME
See Also:
Constant Field Values

DEFAULT_PROD_SERVER_PORT

protected static final String DEFAULT_PROD_SERVER_PORT
See Also:
Constant Field Values

DEFAULT_PROD_SERVER_CONTEXT

protected static final String DEFAULT_PROD_SERVER_CONTEXT
See Also:
Constant Field Values

DEFAULT_PRODUCT_ROOT

protected static final String DEFAULT_PRODUCT_ROOT
See Also:
Constant Field Values

DEFAULT_RETURN_TYPE

protected static final String DEFAULT_RETURN_TYPE
See Also:
Constant Field Values
Constructor Detail

URLGetHandler

public URLGetHandler()
Method Detail

configure

public void configure(Properties prop)
Description copied from interface: OFSNListHandler
Configures this handler with the provided configuration stored in a Properties object.

Specified by:
configure in interface OFSNGetHandler
Specified by:
configure in interface OFSNListHandler
Specified by:
configure in class AbstractCrawlLister
Parameters:
prop - The configuration for this list handler.

retrieveChunk

public byte[] retrieveChunk(String filepath,
                            long offset,
                            int length)
                     throws ProductException
Description copied from interface: OFSNGetHandler
Retrieves a chunk of data from the remote file.

Specified by:
retrieveChunk in interface OFSNGetHandler
Parameters:
filepath - The path to the remote file.
offset - The offset in the remote data to retrieve.
length - The length of data to read
Returns:
The byte[] data, read, or null otherwise.
Throws:
ProductException - If any error occurs.

sizeOf

public long sizeOf(String filepath)
Description copied from interface: OFSNGetHandler
Returns the size of the remote data, which may be the entire file in question, or some subset/transformation on it.

Specified by:
sizeOf in interface OFSNGetHandler
Parameters:
filepath - The remote file in question.
Returns:
The size of the remote file, potentially after a remote transformation has occured.

getListing

public File[] getListing(String filePath)
                  throws ProductException,
                         IllegalArgumentException
Description copied from interface: OFSNListHandler
Handlers that implement this method take an Online File Specification Name and return back a listing of files on the remote server.

Specified by:
getListing in interface OFSNListHandler
Specified by:
getListing in class AbstractCrawlLister
Parameters:
filePath - The OFSN path to list files from.
Returns:
An array of File objects.
Throws:
ProductException - If any error occurs performing the listing on the server side.
IllegalArgumentException


Copyright © 1999-2012 Apache OODT. All Rights Reserved.