Apache Camel to detect manually removed files











up vote
2
down vote

favorite
1












I know it is possible to use Apache Camel for monitoring newly created files and modified files, but is it possible to detect files deleted manually?
I already checked the specification and could not find anything relevant.










share|improve this question






















  • Can you explain moe about the use case? Is this about the camel file component?
    – Christian Schneider
    Nov 20 at 6:20










  • A use case would be to recursively monitor file changes in the given directory. I know it is not standard feature of Apache Camel, but since we use Camel in our project anyway we also wanted to use it to monitor file changes. Unfortunately, to my knowledge, no Exchange is fired when file is deleted. It is about camel file component indeed.
    – Vettel1993
    Nov 20 at 8:44










  • I think the camel file component can not help with this case. What do you want to be triggered by the file changes?
    – Christian Schneider
    Nov 20 at 12:01










  • Nothing special, just to execute one method. I just find it odd that Camel does not support such feature.
    – Vettel1993
    Nov 20 at 16:14










  • I think it is difficult to implement. Especially if you want to recognize files removed while the system is running and while it is not running. You can request the feature on the camel mailing list or jira.
    – Christian Schneider
    Nov 21 at 7:50















up vote
2
down vote

favorite
1












I know it is possible to use Apache Camel for monitoring newly created files and modified files, but is it possible to detect files deleted manually?
I already checked the specification and could not find anything relevant.










share|improve this question






















  • Can you explain moe about the use case? Is this about the camel file component?
    – Christian Schneider
    Nov 20 at 6:20










  • A use case would be to recursively monitor file changes in the given directory. I know it is not standard feature of Apache Camel, but since we use Camel in our project anyway we also wanted to use it to monitor file changes. Unfortunately, to my knowledge, no Exchange is fired when file is deleted. It is about camel file component indeed.
    – Vettel1993
    Nov 20 at 8:44










  • I think the camel file component can not help with this case. What do you want to be triggered by the file changes?
    – Christian Schneider
    Nov 20 at 12:01










  • Nothing special, just to execute one method. I just find it odd that Camel does not support such feature.
    – Vettel1993
    Nov 20 at 16:14










  • I think it is difficult to implement. Especially if you want to recognize files removed while the system is running and while it is not running. You can request the feature on the camel mailing list or jira.
    – Christian Schneider
    Nov 21 at 7:50













up vote
2
down vote

favorite
1









up vote
2
down vote

favorite
1






1





I know it is possible to use Apache Camel for monitoring newly created files and modified files, but is it possible to detect files deleted manually?
I already checked the specification and could not find anything relevant.










share|improve this question













I know it is possible to use Apache Camel for monitoring newly created files and modified files, but is it possible to detect files deleted manually?
I already checked the specification and could not find anything relevant.







apache apache-camel osgi






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 19 at 12:27









Vettel1993

133




133












  • Can you explain moe about the use case? Is this about the camel file component?
    – Christian Schneider
    Nov 20 at 6:20










  • A use case would be to recursively monitor file changes in the given directory. I know it is not standard feature of Apache Camel, but since we use Camel in our project anyway we also wanted to use it to monitor file changes. Unfortunately, to my knowledge, no Exchange is fired when file is deleted. It is about camel file component indeed.
    – Vettel1993
    Nov 20 at 8:44










  • I think the camel file component can not help with this case. What do you want to be triggered by the file changes?
    – Christian Schneider
    Nov 20 at 12:01










  • Nothing special, just to execute one method. I just find it odd that Camel does not support such feature.
    – Vettel1993
    Nov 20 at 16:14










  • I think it is difficult to implement. Especially if you want to recognize files removed while the system is running and while it is not running. You can request the feature on the camel mailing list or jira.
    – Christian Schneider
    Nov 21 at 7:50


















  • Can you explain moe about the use case? Is this about the camel file component?
    – Christian Schneider
    Nov 20 at 6:20










  • A use case would be to recursively monitor file changes in the given directory. I know it is not standard feature of Apache Camel, but since we use Camel in our project anyway we also wanted to use it to monitor file changes. Unfortunately, to my knowledge, no Exchange is fired when file is deleted. It is about camel file component indeed.
    – Vettel1993
    Nov 20 at 8:44










  • I think the camel file component can not help with this case. What do you want to be triggered by the file changes?
    – Christian Schneider
    Nov 20 at 12:01










  • Nothing special, just to execute one method. I just find it odd that Camel does not support such feature.
    – Vettel1993
    Nov 20 at 16:14










  • I think it is difficult to implement. Especially if you want to recognize files removed while the system is running and while it is not running. You can request the feature on the camel mailing list or jira.
    – Christian Schneider
    Nov 21 at 7:50
















Can you explain moe about the use case? Is this about the camel file component?
– Christian Schneider
Nov 20 at 6:20




Can you explain moe about the use case? Is this about the camel file component?
– Christian Schneider
Nov 20 at 6:20












A use case would be to recursively monitor file changes in the given directory. I know it is not standard feature of Apache Camel, but since we use Camel in our project anyway we also wanted to use it to monitor file changes. Unfortunately, to my knowledge, no Exchange is fired when file is deleted. It is about camel file component indeed.
– Vettel1993
Nov 20 at 8:44




A use case would be to recursively monitor file changes in the given directory. I know it is not standard feature of Apache Camel, but since we use Camel in our project anyway we also wanted to use it to monitor file changes. Unfortunately, to my knowledge, no Exchange is fired when file is deleted. It is about camel file component indeed.
– Vettel1993
Nov 20 at 8:44












I think the camel file component can not help with this case. What do you want to be triggered by the file changes?
– Christian Schneider
Nov 20 at 12:01




I think the camel file component can not help with this case. What do you want to be triggered by the file changes?
– Christian Schneider
Nov 20 at 12:01












Nothing special, just to execute one method. I just find it odd that Camel does not support such feature.
– Vettel1993
Nov 20 at 16:14




Nothing special, just to execute one method. I just find it odd that Camel does not support such feature.
– Vettel1993
Nov 20 at 16:14












I think it is difficult to implement. Especially if you want to recognize files removed while the system is running and while it is not running. You can request the feature on the camel mailing list or jira.
– Christian Schneider
Nov 21 at 7:50




I think it is difficult to implement. Especially if you want to recognize files removed while the system is running and while it is not running. You can request the feature on the camel mailing list or jira.
– Christian Schneider
Nov 21 at 7:50












1 Answer
1






active

oldest

votes

















up vote
0
down vote













I have found this question interesting and implemented camel-nio2 component, which is based on NIO.2 WatchService. Feel free to use it.



Docs: https://github.com/bedlaj/camel-nio2



Example:



from("nio2:/tmp/inputPath?events=ENTRY_DELETE")
.process(exchange -> {
FileEvent event = exchange.getIn().getBody(FileEvent.class);
log.info(event.getEventPath()+" removed");
});





share|improve this answer























  • Thanks. We ended up implementing WatchService as well. Seems to be best solution so far.
    – Vettel1993
    Nov 26 at 13:22











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53374643%2fapache-camel-to-detect-manually-removed-files%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













I have found this question interesting and implemented camel-nio2 component, which is based on NIO.2 WatchService. Feel free to use it.



Docs: https://github.com/bedlaj/camel-nio2



Example:



from("nio2:/tmp/inputPath?events=ENTRY_DELETE")
.process(exchange -> {
FileEvent event = exchange.getIn().getBody(FileEvent.class);
log.info(event.getEventPath()+" removed");
});





share|improve this answer























  • Thanks. We ended up implementing WatchService as well. Seems to be best solution so far.
    – Vettel1993
    Nov 26 at 13:22















up vote
0
down vote













I have found this question interesting and implemented camel-nio2 component, which is based on NIO.2 WatchService. Feel free to use it.



Docs: https://github.com/bedlaj/camel-nio2



Example:



from("nio2:/tmp/inputPath?events=ENTRY_DELETE")
.process(exchange -> {
FileEvent event = exchange.getIn().getBody(FileEvent.class);
log.info(event.getEventPath()+" removed");
});





share|improve this answer























  • Thanks. We ended up implementing WatchService as well. Seems to be best solution so far.
    – Vettel1993
    Nov 26 at 13:22













up vote
0
down vote










up vote
0
down vote









I have found this question interesting and implemented camel-nio2 component, which is based on NIO.2 WatchService. Feel free to use it.



Docs: https://github.com/bedlaj/camel-nio2



Example:



from("nio2:/tmp/inputPath?events=ENTRY_DELETE")
.process(exchange -> {
FileEvent event = exchange.getIn().getBody(FileEvent.class);
log.info(event.getEventPath()+" removed");
});





share|improve this answer














I have found this question interesting and implemented camel-nio2 component, which is based on NIO.2 WatchService. Feel free to use it.



Docs: https://github.com/bedlaj/camel-nio2



Example:



from("nio2:/tmp/inputPath?events=ENTRY_DELETE")
.process(exchange -> {
FileEvent event = exchange.getIn().getBody(FileEvent.class);
log.info(event.getEventPath()+" removed");
});






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 25 at 18:04

























answered Nov 25 at 14:16









Bedla

1,6762618




1,6762618












  • Thanks. We ended up implementing WatchService as well. Seems to be best solution so far.
    – Vettel1993
    Nov 26 at 13:22


















  • Thanks. We ended up implementing WatchService as well. Seems to be best solution so far.
    – Vettel1993
    Nov 26 at 13:22
















Thanks. We ended up implementing WatchService as well. Seems to be best solution so far.
– Vettel1993
Nov 26 at 13:22




Thanks. We ended up implementing WatchService as well. Seems to be best solution so far.
– Vettel1993
Nov 26 at 13:22


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53374643%2fapache-camel-to-detect-manually-removed-files%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Costa Masnaga

Fotorealismo

Sidney Franklin