com.planet_ink.coffee_mud.WebMacros
Class FileData

java.lang.Object
  extended by com.planet_ink.coffee_mud.WebMacros.StdWebMacro
      extended by com.planet_ink.coffee_mud.WebMacros.FileData
All Implemented Interfaces:
CMObject, WebMacro, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class FileData
extends StdWebMacro


Constructor Summary
FileData()
           
 
Method Summary
 java.lang.String getFilename(ExternalHTTPRequests httpReq, java.lang.String filename)
          If this macro returns true from isAWebPath(), this will be the substitute filename to use as a page for returning to the caller.
 boolean isAWebPath()
          Whether this macro substitutes as an aspect of the web path instead of a standard web macro.
 java.lang.String name()
          The public name of this macro
 boolean preferBinary()
          Whether the runMacro or runBinaryMacro executor should be called.
 byte[] runBinaryMacro(ExternalHTTPRequests httpReq, java.lang.String parm)
          This method is executed only if this macro returns true for preferBinary().
 java.lang.String runMacro(ExternalHTTPRequests httpReq, java.lang.String parm)
          This method is executed only if this macro returns false for preferBinary().
 
Methods inherited from class com.planet_ink.coffee_mud.WebMacros.StdWebMacro
clearWebMacros, clearWebMacros, colorwebifyOnly, compareTo, copyOf, getSpecialContentHeader, helpHelp, helpHelp, htmlIncomingFilter, htmlIncomingFilter, htmlOutgoingFilter, htmlOutgoingFilter, ID, initializeClass, isAdminMacro, newInstance, parseOrderedParms, parseParms, webify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileData

public FileData()
Method Detail

name

public java.lang.String name()
Description copied from interface: WebMacro
The public name of this macro

Specified by:
name in interface WebMacro
Overrides:
name in class StdWebMacro
Returns:
The public name of this macro

isAWebPath

public boolean isAWebPath()
Description copied from interface: WebMacro
Whether this macro substitutes as an aspect of the web path instead of a standard web macro. If true is returned, URLs such as: http://mydomain.com/mymacroname?firstparm=value&secondparm=value might succeeed

Specified by:
isAWebPath in interface WebMacro
Overrides:
isAWebPath in class StdWebMacro
Returns:
whether this is a wierd URL macro
See Also:
WebMacro.getFilename(ExternalHTTPRequests, String)

preferBinary

public boolean preferBinary()
Description copied from interface: WebMacro
Whether the runMacro or runBinaryMacro executor should be called.

Specified by:
preferBinary in interface WebMacro
Overrides:
preferBinary in class StdWebMacro
Returns:
whether the runBinaryMacro executor should be called instead of runMacro
See Also:
WebMacro.runBinaryMacro(ExternalHTTPRequests, String), WebMacro.runMacro(ExternalHTTPRequests, String)

getFilename

public java.lang.String getFilename(ExternalHTTPRequests httpReq,
                                    java.lang.String filename)
Description copied from interface: WebMacro
If this macro returns true from isAWebPath(), this will be the substitute filename to use as a page for returning to the caller. It may simply return what is given to it.

Specified by:
getFilename in interface WebMacro
Overrides:
getFilename in class StdWebMacro
Parameters:
httpReq - the requests object
filename - the default filename
Returns:
usually the default filename again
See Also:
WebMacro.isAWebPath(), ExternalHTTPRequests

runBinaryMacro

public byte[] runBinaryMacro(ExternalHTTPRequests httpReq,
                             java.lang.String parm)
                      throws HTTPServerException
Description copied from interface: WebMacro
This method is executed only if this macro returns true for preferBinary(). It will execute the macro and return its results as a binary byte array.

Specified by:
runBinaryMacro in interface WebMacro
Overrides:
runBinaryMacro in class StdWebMacro
Parameters:
httpReq - the external requests object
parm - any parameter strigs given to the macro
Returns:
the binary stream result of running this macro
Throws:
HTTPServerException
See Also:
WebMacro.preferBinary(), ExternalHTTPRequests

runMacro

public java.lang.String runMacro(ExternalHTTPRequests httpReq,
                                 java.lang.String parm)
                          throws HTTPServerException
Description copied from interface: WebMacro
This method is executed only if this macro returns false for preferBinary(). It will execute the macro and return its results as a string, which is then substituted for the macro reference in the web page where the macro was found.

Specified by:
runMacro in interface WebMacro
Overrides:
runMacro in class StdWebMacro
Parameters:
httpReq - the external requests object
parm - any parameter strigs given to the macro
Returns:
the string result of running this macro
Throws:
HTTPServerException
See Also:
WebMacro.preferBinary(), ExternalHTTPRequests