Menu

Filewriter filenames

Help
Anonymous
2003-10-06
2003-10-08
  • Anonymous

    Anonymous - 2003-10-06

    Hi!

    I have with good results been using the directoryscanner, flat2xml and xsltransformer in a project I am working on. As the inputfiles in my case already have unique names, I would like to keep the filename through the pipelineprocess. Is it possible to get the filenames from the files the directoryscanner reads and use them in the pipeline filewriter output?

    Regards, Stefan

     
    • Dejan Krsmanovic

      Original file name is stored as attribute under key file_name. Also, you can use document.getName() method which returns the same name...
      For example:
      arch.stageType=FileWriter
      arch.outputFile=c:/www/internet/${document.Name}
      or
      arch.outputFile=c:/www/internet/${document.get('file_name')}

       
    • Anonymous

      Anonymous - 2003-10-07

      Thanks for a quick response!
      The sad thing is that I cant get it to work. I have been using ${ticket.Value} to produce files using the ticket value as the filename and that works fine. But I cant get the ${document...whatever to produce any useful output.

       
    • Anonymous

      Anonymous - 2003-10-08

      Dejan!

      I have found the cause to my problem.
      The name of the file is never passed by the directoryscanner.
      Please include following row of code in the next release of the package.

      new NameValuePair("file_name", file.getName()),

      in the enqueue call in the DirectoryScanner.java file

      Best regards, Stefan

       
      • Dejan Krsmanovic

        Thank Stefan,
        There have been many changes in scanner module since 1.0 release. Since I haven't used directory scanner in production I haven't noticed this bug until now.
        You can use latest CVS version now...

        Dejan

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.