use of java.io.File in project camel by apache.
the class FileConsumeSimpleAbsoluteMoveToRelativeTest method setUp.
@Override
protected void setUp() throws Exception {
deleteDirectory("target/move");
// use current dir as base as absolute path
base = new File("").getAbsolutePath() + "/target/move";
super.setUp();
template.sendBodyAndHeader(fileUrl, "Bye World", Exchange.FILE_NAME, "bye.txt");
template.sendBodyAndHeader(fileUrl, "Hello World", Exchange.FILE_NAME, "sub/hello.txt");
template.sendBodyAndHeader(fileUrl, "Goodday World", Exchange.FILE_NAME, "sub/sub2/goodday.txt");
}
use of java.io.File in project camel by apache.
the class FileConsumeSimpleRelativeMoveToAbsoluteTest method setUp.
@Override
protected void setUp() throws Exception {
deleteDirectory("target/move");
// use current dir as base as absolute path
base = new File("").getAbsolutePath() + "/target/move";
super.setUp();
template.sendBodyAndHeader(fileUrl, "Bye World", Exchange.FILE_NAME, "bye.txt");
template.sendBodyAndHeader(fileUrl, "Hello World", Exchange.FILE_NAME, "sub/hello.txt");
template.sendBodyAndHeader(fileUrl, "Goodday World", Exchange.FILE_NAME, "sub/sub2/goodday.txt");
}
use of java.io.File in project camel by apache.
the class FileConsumerAbsolutePathDefaultMoveTest method setUp.
@Override
protected void setUp() throws Exception {
deleteDirectory("target/reports");
// use current dir as base as absolute path
base = new File("").getAbsolutePath() + "/target/reports";
super.setUp();
}
use of java.io.File in project camel by apache.
the class FileConsumerAbsolutePathTest method setUp.
@Override
protected void setUp() throws Exception {
deleteDirectory("target/reports");
// use current dir as base as absolute path
base = new File("").getAbsolutePath() + "/target/reports";
super.setUp();
}
use of java.io.File in project camel by apache.
the class FileConsumerBeginRenameStrategyTest method testRenameFileExists.
public void testRenameFileExists() throws Exception {
// create a file in inprogress to let there be a duplicate file
File file = new File("target/inprogress");
file.mkdirs();
FileWriter fw = new FileWriter("target/inprogress/london.txt");
try {
fw.write("I was there once in London");
fw.flush();
} finally {
fw.close();
}
MockEndpoint mock = getMockEndpoint("mock:report");
mock.expectedBodiesReceived("Hello London");
template.sendBodyAndHeader("file:target/reports", "Hello London", Exchange.FILE_NAME, "london.txt");
mock.assertIsSatisfied();
}
Aggregations