org.mule.transport.http.components
Class StaticResourceMessageProcessor

java.lang.Object
  extended by org.mule.transport.http.components.StaticResourceMessageProcessor
All Implemented Interfaces:
Initialisable, MessageProcessor

public class StaticResourceMessageProcessor
extends Object
implements MessageProcessor, Initialisable

A MessageProcessor that can be used by HTTP endpoints to serve static files from a directory on the filesystem. This processor allows the user to specify a resourceBase which refers to the local directory from where files will be served from. Additionally, a default file can be specificed for URLs where no file is set


Field Summary
static String DEFAULT_MIME_TYPE
           
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Constructor Summary
StaticResourceMessageProcessor()
           
 
Method Summary
 String getDefaultFile()
           
 String getResourceBase()
           
 void initialise()
          Method used to perform any initialisation work.
 MuleEvent process(MuleEvent event)
          Invokes the MessageProcessor.
 void setDefaultFile(String defaultFile)
           
 void setResourceBase(String resourceBase)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MIME_TYPE

public static final String DEFAULT_MIME_TYPE
See Also:
Constant Field Values
Constructor Detail

StaticResourceMessageProcessor

public StaticResourceMessageProcessor()
Method Detail

initialise

public void initialise()
                throws InitialisationException
Description copied from interface: Initialisable
Method used to perform any initialisation work. If a fatal error occurs during initialisation an InitialisationException should be thrown, causing the Mule instance to shutdown. If the error is recoverable, say by retrying to connect, a RecoverableException should be thrown. There is no guarantee that by throwing a Recoverable exception that the Mule instance will not shut down.

Specified by:
initialise in interface Initialisable
Throws:
InitialisationException - if a fatal error occurs causing the Mule instance to shutdown
RecoverableException - if an error occurs that can be recovered from

process

public MuleEvent process(MuleEvent event)
                  throws MuleException
Description copied from interface: MessageProcessor
Invokes the MessageProcessor.

Specified by:
process in interface MessageProcessor
Parameters:
event - MuleEvent to be processed
Returns:
optional response MuleEvent
Throws:
MuleException

getResourceBase

public String getResourceBase()

setResourceBase

public void setResourceBase(String resourceBase)

getDefaultFile

public String getDefaultFile()

setDefaultFile

public void setDefaultFile(String defaultFile)


Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.