ecologylab.net
Interface ConnectionHelper

All Known Implementing Classes:
ConnectionAdapter

public interface ConnectionHelper

Provides callbacks during ParsedURL.connect, to enable filtering and custom processing as the connect operation unfolds.

Author:
andruid

Method Summary
 void badResult()
          Called at the end of processing, if it turns out that something went wrong while opening the connection.
 void displayStatus(java.lang.String message)
          Used to provid status feedback to the user.
 void handleFileDirectory(java.io.File file)
          When this method is called, you know the file is a directory.
 boolean parseFilesWithSuffix(java.lang.String suffix)
          Tells the connect() method that it should go ahead and create a PURLConnection for files that have this suffix.
 boolean processRedirect(java.net.URL connectionURL)
          Shuffle referential models when a redirect is observed, if you like.
 

Method Detail

handleFileDirectory

void handleFileDirectory(java.io.File file)
When this method is called, you know the file is a directory. Process it if you wish. connect() will return null in this special case.

Parameters:
file -

parseFilesWithSuffix

boolean parseFilesWithSuffix(java.lang.String suffix)
Tells the connect() method that it should go ahead and create a PURLConnection for files that have this suffix.

Parameters:
suffix -
Returns:
true if files with this suffix should be parsed; false if they should be ignored.

badResult

void badResult()
Called at the end of processing, if it turns out that something went wrong while opening the connection.


displayStatus

void displayStatus(java.lang.String message)
Used to provid status feedback to the user.

Parameters:
message -

processRedirect

boolean processRedirect(java.net.URL connectionURL)
                        throws java.lang.Exception
Shuffle referential models when a redirect is observed, if you like.

Parameters:
connectionURL -
Returns:
true if the redirect is o.k., and we should continue processing the connect(). false if the redirect is unacceptable, and we should terminate processing.
Throws:
java.lang.Exception