public class FileConnector
extends org.mule.transport.AbstractConnector
FileConnector is used for setting up listeners on a directory and
for writing files to a directory. The connecotry provides support for defining
file output patterns and filters for receiving files.| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_POLLING_FREQUENCY |
static String |
FILE |
FilenameParser |
filenameParser |
static String |
PROPERTY_DIRECTORY |
static String |
PROPERTY_FILE_AGE |
static String |
PROPERTY_FILE_SIZE |
static String |
PROPERTY_FILE_TIMESTAMP |
static String |
PROPERTY_FILENAME |
static String |
PROPERTY_MOVE_TO_DIRECTORY |
static String |
PROPERTY_MOVE_TO_PATTERN |
static String |
PROPERTY_ORIGINAL_DIRECTORY |
static String |
PROPERTY_ORIGINAL_FILENAME |
static String |
PROPERTY_OUTPUT_PATTERN |
static String |
PROPERTY_READ_FROM_DIRECTORY |
static String |
PROPERTY_SOURCE_DIRECTORY |
static String |
PROPERTY_SOURCE_FILENAME |
static String |
PROPERTY_WRITE_TO_DIRECTORY |
connecting, createMultipleTransactedReceivers, DEFAULT_CONTEXT_START_TIMEOUT, DEFAULT_NUM_CONCURRENT_TX_RECEIVERS, dispatcherFactory, dispatcherPoolFactory, dispatchers, initialStateStopped, lifecycleManager, MULE_CONTEXT_START_TIMEOUT_SYSTEM_PROPERTY, muleContext, muleMessageFactory, name, numberOfConcurrentTransactedReceivers, PROPERTY_POLLING_FREQUENCY, receivers, requesterFactory, requesters, serviceDescriptor, serviceOverrides, sessionHandler, startOnConnect| Constructor and Description |
|---|
FileConnector(org.mule.api.MuleContext context) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
configureDispatcherPool() |
org.mule.api.transport.MuleMessageFactory |
createMuleMessageFactory() |
org.mule.api.transport.MessageReceiver |
createReceiver(org.mule.api.construct.FlowConstruct flowConstruct,
org.mule.api.endpoint.InboundEndpoint endpoint)
Registers a listener for a particular directory The following properties can
be overriden in the endpoint declaration
moveToDirectory
filterPatterns
filterClass
pollingFrequency
|
protected void |
doConnect() |
protected void |
doDisconnect() |
protected void |
doDispose() |
protected void |
doInitialise() |
protected void |
doStart() |
protected void |
doStop() |
boolean |
getCheckFileAge() |
long |
getFileAge() |
FilenameParser |
getFilenameParser() |
String |
getMoveToDirectory() |
String |
getMoveToPattern() |
String |
getOutputPattern() |
FileOutputStream |
getOutputStream() |
OutputStream |
getOutputStream(org.mule.api.endpoint.OutboundEndpoint endpoint,
org.mule.api.MuleEvent event)
Well get the output stream (if any) for this type of transport.
|
long |
getPollingFrequency() |
String |
getProtocol() |
String |
getReadFromDirectory() |
protected Object |
getReceiverKey(org.mule.api.construct.FlowConstruct flowConstruct,
org.mule.api.endpoint.InboundEndpoint endpoint) |
String |
getWorkDirectory() |
String |
getWorkFileNamePattern() |
String |
getWriteToDirectory() |
boolean |
isAutoDelete() |
boolean |
isOutputAppend() |
boolean |
isRecursive() |
boolean |
isSerialiseObjects() |
boolean |
isStreaming() |
protected void |
move(File sourceFile,
File destinationFile) |
void |
setAutoDelete(boolean autoDelete) |
void |
setFileAge(long fileAge) |
void |
setFilenameParser(FilenameParser filenameParser) |
void |
setMaxDispatchersActive(int value) |
void |
setMoveToDirectory(String dir) |
void |
setMoveToPattern(String moveToPattern) |
void |
setOutputAppend(boolean outputAppend) |
void |
setOutputPattern(String outputPattern) |
void |
setOutputStream(FileOutputStream outputStream) |
void |
setPollingFrequency(long pollingFrequency) |
void |
setReadFromDirectory(String dir) |
void |
setRecursive(boolean recursive) |
void |
setSerialiseObjects(boolean serialiseObjects) |
void |
setStreaming(boolean streaming) |
void |
setWorkDirectory(String workDirectoryName) |
void |
setWorkFileNamePattern(String workFileNamePattern) |
void |
setWriteToDirectory(String dir) |
borrowDispatcher, clearDispatchers, clearRequesters, connect, connectConnectorAndReceivers, createDefaultRedeliveryPolicy, createDispatcherMessageProcessor, createOperationResource, createScheduler, destroyReceiver, disconnect, dispose, disposeReceivers, disposeWorkManagers, doUnregisterListener, fireNotification, fireNotification, getCanonicalURI, getConnectEventId, getConnectionDescription, getDefaultExchangePattern, getDefaultInboundTransformers, getDefaultOutboundTransformers, getDefaultResponseTransformers, getDispatcherFactory, getDispatcherPoolFactory, getDispatcherThreadingProfile, getDispatcherWorkManager, getInboundExchangePatterns, getLifecycleState, getMaxDispatchersActive, getMaxRequestersActive, getMaxTotalDispatchers, getMuleContext, getMuleMessageFactory, getName, getNumberOfConcurrentTransactedReceivers, getOperationResourceFactory, getOutboundExchangePatterns, getReceiver, getReceivers, getReceivers, getReceiverThreadingProfile, getReceiverWorkManager, getReplyToHandler, getRequesterFactory, getRequesterThreadingProfile, getRequesterWorkManager, getRetryPolicyTemplate, getScheduler, getServiceDescriptor, getServiceOverrides, getSessionHandler, getSupportedProtocols, getTransactionalResource, handleWorkException, initFromServiceDescriptor, initialise, initialiseFromUrl, initWorkManagers, isConnected, isConnecting, isCreateMultipleTransactedReceivers, isDisposed, isEnableMessageEvents, isEnableMessageEvents, isInitialised, isInitialStateStopped, isResponseEnabled, isStarted, isStarting, isStopped, isStopping, isValidateConnections, lookupReceiver, registerListener, registerSupportedMetaProtocol, registerSupportedProtocol, registerSupportedProtocolWithoutPrefix, request, request, returnDispatcher, setConnected, setConnecting, setCreateMultipleTransactedReceivers, setDispatcherFactory, setDispatcherPoolFactory, setDispatcherPoolMaxWait, setDispatcherPoolWhenExhaustedAction, setDispatcherThreadingProfile, setDynamicNotification, setInitialStateStopped, setMaxRequestersActive, setName, setNumberOfConcurrentTransactedReceivers, setReceiverThreadingProfile, setRequesterFactory, setRequesterPoolMaxWait, setRequesterPoolWhenExhaustedAction, setRequesterThreadingProfile, setRetryPolicyTemplate, setServiceOverrides, setSessionHandler, setSupportedProtocols, setupDispatchReturn, setupRequestReturn, setValidateConnections, shutdownScheduler, start, startAfterConnect, stop, supportsProtocol, toString, unregisterListener, unregisterSupportedProtocol, updateCachedNotificationHandler, validateConnection, workAccepted, workCompleted, workRejected, workStartedpublic static final String FILE
public static final String PROPERTY_FILE_AGE
public static final String PROPERTY_MOVE_TO_PATTERN
public static final String PROPERTY_MOVE_TO_DIRECTORY
public static final String PROPERTY_READ_FROM_DIRECTORY
public static final String PROPERTY_OUTPUT_PATTERN
public static final String PROPERTY_FILENAME
public static final String PROPERTY_ORIGINAL_FILENAME
public static final String PROPERTY_ORIGINAL_DIRECTORY
public static final String PROPERTY_DIRECTORY
public static final String PROPERTY_SOURCE_FILENAME
public static final String PROPERTY_SOURCE_DIRECTORY
public static final String PROPERTY_WRITE_TO_DIRECTORY
public static final String PROPERTY_FILE_SIZE
public static final String PROPERTY_FILE_TIMESTAMP
public static final long DEFAULT_POLLING_FREQUENCY
public FilenameParser filenameParser
protected void configureDispatcherPool()
configureDispatcherPool in class org.mule.transport.AbstractConnectorpublic void setMaxDispatchersActive(int value)
setMaxDispatchersActive in class org.mule.transport.AbstractConnectorprotected Object getReceiverKey(org.mule.api.construct.FlowConstruct flowConstruct, org.mule.api.endpoint.InboundEndpoint endpoint)
getReceiverKey in class org.mule.transport.AbstractConnectorpublic org.mule.api.transport.MessageReceiver createReceiver(org.mule.api.construct.FlowConstruct flowConstruct,
org.mule.api.endpoint.InboundEndpoint endpoint)
throws Exception
createReceiver in class org.mule.transport.AbstractConnectorExceptionpublic String getProtocol()
public FilenameParser getFilenameParser()
public void setFilenameParser(FilenameParser filenameParser)
protected void doDispose()
doDispose in class org.mule.transport.AbstractConnectorprotected void doInitialise()
throws org.mule.api.lifecycle.InitialisationException
doInitialise in class org.mule.transport.AbstractConnectororg.mule.api.lifecycle.InitialisationExceptionprotected void doConnect()
throws Exception
doConnect in class org.mule.transport.AbstractConnectorExceptionprotected void doDisconnect()
throws Exception
doDisconnect in class org.mule.transport.AbstractConnectorExceptionprotected void doStart()
throws org.mule.api.MuleException
doStart in class org.mule.transport.AbstractConnectororg.mule.api.MuleExceptionprotected void doStop()
throws org.mule.api.MuleException
doStop in class org.mule.transport.AbstractConnectororg.mule.api.MuleExceptionpublic String getMoveToDirectory()
public void setMoveToDirectory(String dir)
public void setWorkDirectory(String workDirectoryName) throws IOException
IOExceptionpublic String getWorkDirectory()
public void setWorkFileNamePattern(String workFileNamePattern)
public String getWorkFileNamePattern()
public boolean isOutputAppend()
public void setOutputAppend(boolean outputAppend)
public String getOutputPattern()
public void setOutputPattern(String outputPattern)
public FileOutputStream getOutputStream()
public void setOutputStream(FileOutputStream outputStream)
public long getPollingFrequency()
public void setPollingFrequency(long pollingFrequency)
public long getFileAge()
public boolean getCheckFileAge()
public void setFileAge(long fileAge)
public String getWriteToDirectory()
public void setWriteToDirectory(String dir) throws IOException
IOExceptionpublic String getReadFromDirectory()
public void setReadFromDirectory(String dir) throws IOException
IOExceptionpublic boolean isSerialiseObjects()
public void setSerialiseObjects(boolean serialiseObjects)
public boolean isAutoDelete()
public void setAutoDelete(boolean autoDelete)
public String getMoveToPattern()
public void setMoveToPattern(String moveToPattern)
public OutputStream getOutputStream(org.mule.api.endpoint.OutboundEndpoint endpoint, org.mule.api.MuleEvent event) throws org.mule.api.MuleException
getOutputStream in interface org.mule.api.transport.ConnectorgetOutputStream in class org.mule.transport.AbstractConnectorendpoint - the endpoint that releates to this Dispatcherevent - the current event being processedorg.mule.api.MuleExceptionprotected void move(File sourceFile, File destinationFile) throws org.mule.api.DefaultMuleException
org.mule.api.DefaultMuleExceptionpublic boolean isStreaming()
public void setStreaming(boolean streaming)
public org.mule.api.transport.MuleMessageFactory createMuleMessageFactory()
throws org.mule.api.lifecycle.CreateException
createMuleMessageFactory in interface org.mule.api.transport.ConnectorcreateMuleMessageFactory in class org.mule.transport.AbstractConnectororg.mule.api.lifecycle.CreateExceptionpublic boolean isRecursive()
public void setRecursive(boolean recursive)
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.