1

I am having trouble fixing this simple route, getting exception right after execute. Seems like execute is acting as Producer and over writing file.

Exception:

org.apache.camel.component.file.GenericFileOperationFailedException: Cannot store file: C:\camel_tests\stage\Downloads.rar

Route:

Home directory will have a rar file with images, that should be extracted with winrar.exe, each file in the rar is file processed, and eventually moved to arch directory once this route done. Last successful stage is extracting files in the stage directory.

Here CMD_EXPLODE = "\"C:/Program Files/WinRAR/WinRAR.exe\"";

from("file://C:/camel_tests/home?fileName=Downloads.rar&preMove=//C:/camel_tests/stage")
.to("exec:"+Consts.CMD_EXPLODE+"?args=e Downloads.rar&workingDir=C:/camel_tests/stage&outFile=decompress_output.txt")
.to("file://C:/camel_tests/stage?exclude=.*.rar")
.process(new PrintFiles())
.to("file://C:/camel_tests/stage?fileName=Downloads.rar&move=//C:/camel_tests/arch").end();
4

1 回答 1

1

你应该把它分成2条路线。第一个执行 from -> exec 和第二个 from -> process -> to

然后第二个将处理从 winrar 提取的每个文件。

于 2012-09-12T15:21:36.553 回答