Interface FileEndpointBuilderFactory.FileEndpointProducerBuilder

  • All Superinterfaces:
    org.apache.camel.builder.EndpointProducerBuilder, org.apache.camel.EndpointProducerResolver
    All Known Subinterfaces:
    FileEndpointBuilderFactory.FileEndpointBuilder
    Enclosing interface:
    FileEndpointBuilderFactory

    public static interface FileEndpointBuilderFactory.FileEndpointProducerBuilder
    extends org.apache.camel.builder.EndpointProducerBuilder
    Builder for endpoint producers for the File component.
    • Method Detail

      • charset

        default FileEndpointBuilderFactory.FileEndpointProducerBuilder charset​(String charset)
        This option is used to specify the encoding of the file. You can use this on the consumer, to specify the encodings of the files, which allow Camel to know the charset it should load the file content in case the file content is being accessed. Likewise when writing a file, you can use this option to specify which charset to write the file as well. Do mind that when writing the file Camel may have to read the message content into memory to be able to convert the data into the configured charset, so do not use this if you have big messages. The option is a: java.lang.String type. Group: common
      • doneFileName

        default FileEndpointBuilderFactory.FileEndpointProducerBuilder doneFileName​(String doneFileName)
        Producer: If provided, then Camel will write a 2nd done file when the original file has been written. The done file will be empty. This option configures what file name to use. Either you can specify a fixed name. Or you can use dynamic placeholders. The done file will always be written in the same folder as the original file. Consumer: If provided, Camel will only consume files if a done file exists. This option configures what file name to use. Either you can specify a fixed name. Or you can use dynamic placeholders.The done file is always expected in the same folder as the original file. Only ${file.name} and ${file.name.next} is supported as dynamic placeholders. The option is a: java.lang.String type. Group: common
      • fileName

        default FileEndpointBuilderFactory.FileEndpointProducerBuilder fileName​(org.apache.camel.Expression fileName)
        Use Expression such as File Language to dynamically set the filename. For consumers, it's used as a filename filter. For producers, it's used to evaluate the filename to write. If an expression is set, it take precedence over the CamelFileName header. (Note: The header itself can also be an Expression). The expression options support both String and Expression types. If the expression is a String type, it is always evaluated using the File Language. If the expression is an Expression type, the specified Expression type is used - this allows you, for instance, to use OGNL expressions. For the consumer, you can use it to filter filenames, so you can for instance consume today's file using the File Language syntax: mydata-${date:now:yyyyMMdd}.txt. The producers support the CamelOverruleFileName header which takes precedence over any existing CamelFileName header; the CamelOverruleFileName is a header that is used only once, and makes it easier as this avoids to temporary store CamelFileName and have to restore it afterwards. The option is a: org.apache.camel.Expression type. Group: common
      • fileName

        default FileEndpointBuilderFactory.FileEndpointProducerBuilder fileName​(String fileName)
        Use Expression such as File Language to dynamically set the filename. For consumers, it's used as a filename filter. For producers, it's used to evaluate the filename to write. If an expression is set, it take precedence over the CamelFileName header. (Note: The header itself can also be an Expression). The expression options support both String and Expression types. If the expression is a String type, it is always evaluated using the File Language. If the expression is an Expression type, the specified Expression type is used - this allows you, for instance, to use OGNL expressions. For the consumer, you can use it to filter filenames, so you can for instance consume today's file using the File Language syntax: mydata-${date:now:yyyyMMdd}.txt. The producers support the CamelOverruleFileName header which takes precedence over any existing CamelFileName header; the CamelOverruleFileName is a header that is used only once, and makes it easier as this avoids to temporary store CamelFileName and have to restore it afterwards. The option will be converted to a org.apache.camel.Expression type. Group: common
      • appendChars

        default FileEndpointBuilderFactory.FileEndpointProducerBuilder appendChars​(String appendChars)
        Used to append characters (text) after writing files. This can for example be used to add new lines or other separators when writing and appending to existing files. To specify new-line (slash-n or slash-r) or tab (slash-t) characters then escape with an extra slash, eg slash-slash-n. The option is a: java.lang.String type. Group: producer
      • fileExist

        default FileEndpointBuilderFactory.FileEndpointProducerBuilder fileExist​(FileEndpointBuilderFactory.GenericFileExist fileExist)
        What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. - Append - adds content to the existing file. - Fail - throws a GenericFileOperationException, indicating that there is already an existing file. - Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. - Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile can be used to control what to do if an moving the file, and there exists already an existing file, otherwise causing the move operation to fail. The Move option will move any existing files, before writing the target file. - TryRename is only applicable if tempFileName option is in use. This allows to try renaming the file from the temporary name to the actual name, without doing any exists check. This check may be faster on some file systems and especially FTP servers. The option is a: org.apache.camel.component.file.GenericFileExist type. Default: Override Group: producer
      • fileExist

        default FileEndpointBuilderFactory.FileEndpointProducerBuilder fileExist​(String fileExist)
        What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. - Append - adds content to the existing file. - Fail - throws a GenericFileOperationException, indicating that there is already an existing file. - Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. - Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile can be used to control what to do if an moving the file, and there exists already an existing file, otherwise causing the move operation to fail. The Move option will move any existing files, before writing the target file. - TryRename is only applicable if tempFileName option is in use. This allows to try renaming the file from the temporary name to the actual name, without doing any exists check. This check may be faster on some file systems and especially FTP servers. The option will be converted to a org.apache.camel.component.file.GenericFileExist type. Default: Override Group: producer
      • flatten

        default FileEndpointBuilderFactory.FileEndpointProducerBuilder flatten​(boolean flatten)
        Flatten is used to flatten the file name path to strip any leading paths, so it's just the file name. This allows you to consume recursively into sub-directories, but when you eg write the files to another directory they will be written in a single directory. Setting this to true on the producer enforces that any file name in CamelFileName header will be stripped for any leading paths. The option is a: boolean type. Default: false Group: producer
      • flatten

        default FileEndpointBuilderFactory.FileEndpointProducerBuilder flatten​(String flatten)
        Flatten is used to flatten the file name path to strip any leading paths, so it's just the file name. This allows you to consume recursively into sub-directories, but when you eg write the files to another directory they will be written in a single directory. Setting this to true on the producer enforces that any file name in CamelFileName header will be stripped for any leading paths. The option will be converted to a boolean type. Default: false Group: producer
      • jailStartingDirectory

        default FileEndpointBuilderFactory.FileEndpointProducerBuilder jailStartingDirectory​(boolean jailStartingDirectory)
        Used for jailing (restricting) writing files to the starting directory (and sub) only. This is enabled by default to not allow Camel to write files to outside directories (to be more secured out of the box). You can turn this off to allow writing files to directories outside the starting directory, such as parent or root folders. The option is a: boolean type. Default: true Group: producer
      • jailStartingDirectory

        default FileEndpointBuilderFactory.FileEndpointProducerBuilder jailStartingDirectory​(String jailStartingDirectory)
        Used for jailing (restricting) writing files to the starting directory (and sub) only. This is enabled by default to not allow Camel to write files to outside directories (to be more secured out of the box). You can turn this off to allow writing files to directories outside the starting directory, such as parent or root folders. The option will be converted to a boolean type. Default: true Group: producer
      • lazyStartProducer

        default FileEndpointBuilderFactory.FileEndpointProducerBuilder lazyStartProducer​(boolean lazyStartProducer)
        Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. The option is a: boolean type. Default: false Group: producer
      • lazyStartProducer

        default FileEndpointBuilderFactory.FileEndpointProducerBuilder lazyStartProducer​(String lazyStartProducer)
        Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. The option will be converted to a boolean type. Default: false Group: producer
      • moveExisting

        default FileEndpointBuilderFactory.FileEndpointProducerBuilder moveExisting​(org.apache.camel.Expression moveExisting)
        Expression (such as File Language) used to compute file name to use when fileExist=Move is configured. To move files into a backup subdirectory just enter backup. This option only supports the following File Language tokens: file:name, file:name.ext, file:name.noext, file:onlyname, file:onlyname.noext, file:ext, and file:parent. Notice the file:parent is not supported by the FTP component, as the FTP component can only move any existing files to a relative directory based on current dir as base. The option is a: org.apache.camel.Expression type. Group: producer
      • moveExisting

        default FileEndpointBuilderFactory.FileEndpointProducerBuilder moveExisting​(String moveExisting)
        Expression (such as File Language) used to compute file name to use when fileExist=Move is configured. To move files into a backup subdirectory just enter backup. This option only supports the following File Language tokens: file:name, file:name.ext, file:name.noext, file:onlyname, file:onlyname.noext, file:ext, and file:parent. Notice the file:parent is not supported by the FTP component, as the FTP component can only move any existing files to a relative directory based on current dir as base. The option will be converted to a org.apache.camel.Expression type. Group: producer
      • tempFileName

        default FileEndpointBuilderFactory.FileEndpointProducerBuilder tempFileName​(org.apache.camel.Expression tempFileName)
        The same as tempPrefix option but offering a more fine grained control on the naming of the temporary filename as it uses the File Language. The location for tempFilename is relative to the final file location in the option 'fileName', not the target directory in the base uri. For example if option fileName includes a directory prefix: dir/finalFilename then tempFileName is relative to that subdirectory dir. The option is a: org.apache.camel.Expression type. Group: producer
      • tempFileName

        default FileEndpointBuilderFactory.FileEndpointProducerBuilder tempFileName​(String tempFileName)
        The same as tempPrefix option but offering a more fine grained control on the naming of the temporary filename as it uses the File Language. The location for tempFilename is relative to the final file location in the option 'fileName', not the target directory in the base uri. For example if option fileName includes a directory prefix: dir/finalFilename then tempFileName is relative to that subdirectory dir. The option will be converted to a org.apache.camel.Expression type. Group: producer
      • tempPrefix

        default FileEndpointBuilderFactory.FileEndpointProducerBuilder tempPrefix​(String tempPrefix)
        This option is used to write the file using a temporary name and then, after the write is complete, rename it to the real name. Can be used to identify files being written and also avoid consumers (not using exclusive read locks) reading in progress files. Is often used by FTP when uploading big files. The option is a: java.lang.String type. Group: producer