3 Replies Latest reply on Jan 25, 2012 5:39 PM by dankibler

    fs-provider Include a timestamp in the post filename to avoid name clash

    stsc

      I'm using an fs-provider to pickup files and put them on the ESB.

       

      I cannot control the system that deliver files, so over time there might be two files with the same name but different content. For logging purpose, I would like to keep the original file with a timestamp appended, e.g.: input.csv to become input.csv.20120111.155800.ok.

       

      The last part of the suffix (.ok) is quite easy, but how about the date part? (20120111.155800) year-month-day-hour-min-sec?

       

      My fs-provider tag look like this:

      <fs-provider name="FSprovider">

               <fs-bus busid="consumer-update-gw">

                      <fs-message-filter directory="${consumer.update.dir}"

                                         input-suffix=".csv"

                                         post-delete="false"

                                         error-delete="false"

                                         post-directory="${consumer.update.post-dir}"

                                         post-suffix=".ok"

                                         work-suffix=".work"

                                         error-directory="${consumer.update.error-dir}"

                                         error-suffix=".esbError"

                                          />

              </fs-bus>

      </fs-provider>

       

      Is there a "tag" or something there can be used to format a date as part of the suffix?

       

      regards

      Steffen