Skip to main content
Question

Directory watch file types


swach
Contributor
Forum|alt.badge.img+6
  • Contributor

Is there a way to control which file types directory watch processes? I have a process set up to run xml files triggered through directory watch. Folders containing jpgs are also copied to this directory (I have no control over this). These folders trigger the process then fail. Is there some way to tell directory watch to only process xmls?

2 replies

david_r
Celebrity
  • December 10, 2015

Hi

You should analyze the JSON that is generated by the watcher to test for the file type. Here is a sample message:

{
    "ws_topic": "SAMPLE_TOPIC",
    "dirwatch_publisher_path": "c:\\temp\\test.xml",
    "dirwatch_publisher_content": "ENTRY_CREATE c:\\temp\\test.xml",
    "dirwatch_publisher_action": "CREATE",
    "fns_type": "dirwatch_publisher"
}

In other words, you should test that "dirwatch_publisher_content" ends with ".xml" before starting your process.

David


fmelizard
Safer
Forum|alt.badge.img+18
  • Safer
  • December 28, 2015

@swach, David definitely has the right idea. Speaking of ideas, it would be great if you filed this request in our Ideas database: https://knowledge.safe.com/content/idea/post.html

Then the rest of the community can vote it up. More votes equals more likely to get done. Thanks for getting involved!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings