ExpressionFilenameParser (Mule ESB 2.2.1 API)
Keywords: org.mule.transport.file.ExpressionFilenameParser class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mule.transport.file
Class ExpressionFilenameParser

    java.lang.Object
      org.mule.transport.file.ExpressionFilenameParser

All Implemented Interfaces:
  MuleContextAware, FilenameParser

    public class ExpressionFilenameParser

extends Object
implements FilenameParser, MuleContextAware

`ExpressionFilenameParser` can use any expression language supported by Mule to construct a file name for the current message. Expressions can be xpath, xquery, ognl, mvel, header, function and more. For more information see http://muledocs.org/v2/Expressions.

For example an xpath expression can be defined to pull a message id out of an xml message and use that as the file name - `#[xpath:/message/header/@id]`

This parser superseeds the `SimpleFilenameParser` which has been kept in Mule 2 for compatibility. The following demonstrates how to achieve the same results when using the `ExpressionFilenameParser` over the `SimpleFilenameParser`.

- #[DATE] : #[function:dateStamp]
- #[DATE:yy-MM-dd] : #[function:dateStamp(yy-MM-dd)]
- #[SYSTIME] : #[function:systime]
- #[UUID] : #[function:uuid]
- #[ORIGINALNAME] : #[header:originalFilename]
- #[COUNT] : #[function:counter] - note that this is a global counter. If you want a local counter per file connector then you should use the `SimpleFilenameParser`.
- #[<Message Property Name>] : #[header:<Message Property Name>]

Field Summary
`static String` | `DEFAULT_DATE_FORMAT`
`static String` | `DEFAULT_EXPRESSION`

Constructor Summary
`ExpressionFilenameParser()`

Method Summary
`String` | `getFilename(MessageAdapter adapter, String expression)`
`protected String` | `getFilename(MessageAdapter adapter, String expression, TemplateParser parser)`
`void` | `setMuleContext(MuleContext context)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_DATE_FORMAT

    public static final String DEFAULT_DATE_FORMAT

See Also:
  Constant Field Values

### DEFAULT_EXPRESSION

    public static final String DEFAULT_EXPRESSION

Constructor Detail

### ExpressionFilenameParser

    public ExpressionFilenameParser()

Method Detail

### setMuleContext

    public void setMuleContext(MuleContext context)

  Specified by:
    `setMuleContext` in interface `MuleContextAware`

### getFilename

    public String getFilename(MessageAdapter adapter,
                              String expression)

  Specified by:
    `getFilename` in interface `FilenameParser`

### getFilename

    protected String getFilename(MessageAdapter adapter,
                                 String expression,
                                 TemplateParser parser)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.