You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Ole Andreas Hegle <he...@businesscape.no> on 2007/09/27 17:43:15 UTC
File-component, feature request
Hi
I have a feature request for the file-component, to allow use of
absolute paths
When I use the file component in windows to read file from one disk and
should write the processed file to another disk, Camel is not able to
support this.
(We have mapped a directory from another server on the computer where
camel runs, ant when file is read from the remote directory, it should
be stored as a backup on the local disk)
I have tried to create a shortcut to F:/ on C, but it the took it for a
folder and created the folder on C in stead of following the link to
F-disk and monitoring the folder there.
Looking forward to hearing any solution suggestions.
Added a code-sample below, with code showing the error.
Regards Ole Andreas Hegle
Software developer
Businesscape AS
Here is an example code:
public void configure(){
from("file://F:/NewTextiles/temp/testfolder?moveNamePrefix=C:/backup").process(new
TestFileProcessor());
}
Here is the error:
File found F:\NewTextiles\temp\testfolder\New Text Document.txt
27.sep.2007 17:36:21 org.apache.camel.processor.Logger log
SEVERE: Could not rename file from: F:\NewTextiles\temp\testfolder\New
Text Document.txt to F:\NewTextiles\temp\testfolder\C:\backup\New Text
Document.txt
java.io.IOException: Could not rename file from:
F:\NewTextiles\temp\testfolder\New Text Document.txt to
F:\NewTextiles\temp\testfolder\C:\backup\New Text Document.txt
at
org.apache.camel.component.file.strategy.RenameFileProcessStrategy.commit(RenameFileProcessStrategy.java:62)
at
org.apache.camel.component.file.FileConsumer.pollFile(FileConsumer.java:90)
at
org.apache.camel.component.file.FileConsumer.pollFileOrDirectory(FileConsumer.java:49)
at
org.apache.camel.component.file.FileConsumer.pollFileOrDirectory(FileConsumer.java:56)
at
org.apache.camel.component.file.FileConsumer.poll(FileConsumer.java:43)
at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:63)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
27.sep.2007 17:36:21 org.apache.camel.processor.Logger log
SEVERE: null
java.nio.channels.OverlappingFileLockException
at
sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList(FileChannelImpl.java:1173)
at
sun.nio.ch.FileChannelImpl$SharedFileLockTable.add(FileChannelImpl.java:1075)
at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:837)
at java.nio.channels.FileChannel.lock(FileChannel.java:860)
at
org.apache.camel.component.file.strategy.FileProcessStrategySupport.begin(FileProcessStrategySupport.java:63)
at
org.apache.camel.component.file.FileConsumer.pollFile(FileConsumer.java:88)
at
org.apache.camel.component.file.FileConsumer.pollFileOrDirectory(FileConsumer.java:49)
at
org.apache.camel.component.file.FileConsumer.pollFileOrDirectory(FileConsumer.java:56)
at
org.apache.camel.component.file.FileConsumer.poll(FileConsumer.java:43)
at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:63)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
27.sep.2007 17:36:22 org.apache.camel.processor.Logger log
Re: File-component, feature request
Posted by Hiram Chirino <hi...@hiramchirino.com>.
Hi Ole,
I've just committed a fix so that this is supported. Please get a
fresh camel update and try again.
On 9/27/07, Ole Andreas Hegle <he...@businesscape.no> wrote:
> Hi
>
> I have a feature request for the file-component, to allow use of
> absolute paths
>
> When I use the file component in windows to read file from one disk and
> should write the processed file to another disk, Camel is not able to
> support this.
>
> (We have mapped a directory from another server on the computer where
> camel runs, ant when file is read from the remote directory, it should
> be stored as a backup on the local disk)
>
> I have tried to create a shortcut to F:/ on C, but it the took it for a
> folder and created the folder on C in stead of following the link to
> F-disk and monitoring the folder there.
>
> Looking forward to hearing any solution suggestions.
>
> Added a code-sample below, with code showing the error.
>
> Regards Ole Andreas Hegle
> Software developer
> Businesscape AS
>
>
> Here is an example code:
> public void configure(){
>
> from("file://F:/NewTextiles/temp/testfolder?moveNamePrefix=C:/backup").process(new
> TestFileProcessor());
> }
>
>
>
>
> Here is the error:
>
> File found F:\NewTextiles\temp\testfolder\New Text Document.txt
> 27.sep.2007 17:36:21 org.apache.camel.processor.Logger log
> SEVERE: Could not rename file from: F:\NewTextiles\temp\testfolder\New
> Text Document.txt to F:\NewTextiles\temp\testfolder\C:\backup\New Text
> Document.txt
> java.io.IOException: Could not rename file from:
> F:\NewTextiles\temp\testfolder\New Text Document.txt to
> F:\NewTextiles\temp\testfolder\C:\backup\New Text Document.txt
> at
> org.apache.camel.component.file.strategy.RenameFileProcessStrategy.commit(RenameFileProcessStrategy.java:62)
> at
> org.apache.camel.component.file.FileConsumer.pollFile(FileConsumer.java:90)
> at
> org.apache.camel.component.file.FileConsumer.pollFileOrDirectory(FileConsumer.java:49)
> at
> org.apache.camel.component.file.FileConsumer.pollFileOrDirectory(FileConsumer.java:56)
> at
> org.apache.camel.component.file.FileConsumer.poll(FileConsumer.java:43)
> at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:63)
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
> at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> at java.lang.Thread.run(Thread.java:619)
> 27.sep.2007 17:36:21 org.apache.camel.processor.Logger log
> SEVERE: null
> java.nio.channels.OverlappingFileLockException
> at
> sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList(FileChannelImpl.java:1173)
> at
> sun.nio.ch.FileChannelImpl$SharedFileLockTable.add(FileChannelImpl.java:1075)
> at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:837)
> at java.nio.channels.FileChannel.lock(FileChannel.java:860)
> at
> org.apache.camel.component.file.strategy.FileProcessStrategySupport.begin(FileProcessStrategySupport.java:63)
> at
> org.apache.camel.component.file.FileConsumer.pollFile(FileConsumer.java:88)
> at
> org.apache.camel.component.file.FileConsumer.pollFileOrDirectory(FileConsumer.java:49)
> at
> org.apache.camel.component.file.FileConsumer.pollFileOrDirectory(FileConsumer.java:56)
> at
> org.apache.camel.component.file.FileConsumer.poll(FileConsumer.java:43)
> at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:63)
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
> at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> at java.lang.Thread.run(Thread.java:619)
> 27.sep.2007 17:36:22 org.apache.camel.processor.Logger log
>
>
>
>
>
--
Regards,
Hiram
Blog: http://hiramchirino.com