Search in sources :

Example 91 with File

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");
}
Also used : File(java.io.File)

Example 92 with File

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");
}
Also used : File(java.io.File)

Example 93 with File

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();
}
Also used : File(java.io.File)

Example 94 with File

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();
}
Also used : File(java.io.File)

Example 95 with File

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();
}
Also used : MockEndpoint(org.apache.camel.component.mock.MockEndpoint) FileWriter(java.io.FileWriter) File(java.io.File)

Aggregations

File (java.io.File)45560 IOException (java.io.IOException)9550 Test (org.junit.Test)9009 FileOutputStream (java.io.FileOutputStream)3388 ArrayList (java.util.ArrayList)3273 FileInputStream (java.io.FileInputStream)2915 InputStream (java.io.InputStream)1783 FileNotFoundException (java.io.FileNotFoundException)1743 URL (java.net.URL)1649 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1478 Test (org.testng.annotations.Test)1411 HashMap (java.util.HashMap)1404 RandomAccessFile (java.io.RandomAccessFile)1154 FileWriter (java.io.FileWriter)1081 Properties (java.util.Properties)1019 ZipFile (java.util.zip.ZipFile)959 JarFile (java.util.jar.JarFile)866 List (java.util.List)850 BufferedReader (java.io.BufferedReader)840 OutputStream (java.io.OutputStream)811