/* this belongs to the WebRaveler package */ package webraveler.plugin; import java.util.*; import webraveler.http.HTTPResponse; import webraveler.html.HTMLPage2; import webraveler.ravel.Raveler; import webraveler.vurl.HelpVURL; import webraveler.vurl.PluginChangePref; import webraveler.vurl.PluginConfig; import webraveler.vurl.TextReplaceVURL; /** * A Web Raveler plugin to replace text (by matching a regular * expression) in the entity of any HTTPMessage with content-type * text/* (that is, any content-type which starts with "text/", not * the content-type that equals "text/*") * * @author The Web Raveler Development Squad * @version 1.0 */ public class NoCachePlugin extends webraveler.ravel.RavelerPlugin { /* variables */ String fullURL; boolean DEBUG = false; /* constructors */ /** * The default constructor, called from WebRaveler2.Raveler */ public NoCachePlugin() { name = "NoCachePlugin"; mimeTypes.add("text/html"); } /* methods */ /** * Start executing the plugin when given a response * * @param response an HTTPResponse with the response to be modified * @return an HTTPResponse object, the result of running the plugin on the input response */ public HTTPResponse execute(HTTPResponse response, Hashtable attributes) { response.setHeader("cache-control","no-cache"); return response; } /** * Do the setup stuff with Raveler - banner setup, etc. * Put the plugin on Raveler's "plugin vector" */ public boolean initialize() { /* Add virtual urls for configuration */ String fullURL1; Vector attributes = new Vector(); return true; } /** * Terminate the Plugin - Hasta la vista, BABY! */ public void terminate() { } /** * Return the default configuration for this plugin as a hash table. * */ public void setDefaultAttributes() { attributes = new Hashtable(); } } //class RavelerPlugin