org.erowid.sperowider
Class PatternMatchingHandler

java.lang.Object
  extended byorg.erowid.sperowider.AHandler
      extended byorg.erowid.sperowider.PatternMatchingHandler

public class PatternMatchingHandler
extends AHandler

Uses the contents of a Sperowider custom tag inside of the passed in file to identify a regex pattern as the mongling policy.

Version:
: $Header: /cvsroot/sperowider/SPEROWIDER_MODULE/javasource/org/erowid/sperowider/PatternMatchingHandler.java,v 1.7 2005/01/15 23:26:15 gurustu Exp $
Author:
: $Author: gurustu $

Constructor Summary
PatternMatchingHandler()
           
 
Method Summary
 void download(HttpURLConnection connection, String fileName, String originalURL)
          Downloads a file via the passed in connection, and detects URLs using the Sperowider pattern matching command embedded in the found file.
 void rectify(String filename)
          See download(HttpURLConnection, String, String) to see how URLs are rectified using this handler.
 
Methods inherited from class org.erowid.sperowider.AHandler
addURLToModel, getFileOutputStream, getReplaceableFilenameSuffixes, getRequiredFilenamePrefix, getRequiredFilenameSuffix, getSperowiderContext, setSperowiderContext, stampFile, urlFoundInRectify, urlFoundInSpider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatternMatchingHandler

public PatternMatchingHandler()
Method Detail

download

public void download(HttpURLConnection connection,
                     String fileName,
                     String originalURL)
              throws IOException
Downloads a file via the passed in connection, and detects URLs using the Sperowider pattern matching command embedded in the found file. That command would look like : // <spero-mongle><pattern>"((/[^"]+)|(http://[^"]+))"</pattern><group>1</group><replace-with>SperoDocRoot + "includes/headers/" + "${URL}"</replace-with></spero-mongle>

Specified by:
download in class AHandler
Throws:
IOException

rectify

public void rectify(String filename)
             throws IOException
See download(HttpURLConnection, String, String) to see how URLs are rectified using this handler.

Specified by:
rectify in class AHandler
Throws:
IOException

spero logo small Sperowider is
© 2005 Erowid.org