2013-12-17 38 views
1

我是駱駝新手。我試圖創建一個小應用程序,允許我將文件從一個位置移動到另一個位置。由於各種原因,我被迫使用駱駝。我可以執行移動,但當文件夾中沒有更多文件時,我無法讓駝峯停止。我嘗試了幾種方式,但沒有成功。駱駝停止當文件夾中沒有文件

這裏是我使用的代碼:

try { 
    Main main = new Main(); 
    main.addRouteBuilder(createRouteBuilder()); 
    main.run(); 
} catch (Exception e1) { 
    e1.printStackTrace(); 
} 

protected RouteBuilder createRouteBuilder() throws Exception { 
    return new RouteBuilder() { 
     public void configure() throws Exception { 
      from("file:./xxx").to("file:C:\\tomcat-6.0.37\\apache-tomcat-6.0.37\\yyy"); 
     } 
    }; 
} 
+0

當沒有更多文件時,您希望停止什麼樣的行爲? – Ralf

+0

您可能想嘗試如下所示: http://stackoverflow.com/a/9099553/6264 –

回答