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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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')}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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')}
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.
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
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