Issue #3026 - Fixed pattern to match the actual file names
Change-Id: I957e2076cfa5ee4d59acc1a0db89066e446bfc99 Former-commit-id:edb85525d0
[formerly9be37bb41e
] [formerlyf841f1eda9
[formerly 5a3ccbadbf08957a4f68a0cb7118c765ca44f849]] Former-commit-id:f841f1eda9
Former-commit-id:f1c4463316
This commit is contained in:
parent
da8130d7be
commit
1f1436a0da
1 changed files with 3 additions and 2 deletions
|
@ -36,6 +36,7 @@ import org.apache.camel.Processor;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 21, 2014 3026 mpduff Initial creation
|
||||
* Nov 18, 2014 3026 mpduff Changed regex pattern to match filename.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -46,7 +47,7 @@ import org.apache.camel.Processor;
|
|||
public class HpeGribFileNameProcessor implements Processor {
|
||||
/** Filename pattern to match for HPE grib files */
|
||||
private static final Pattern FILENAME_PATTERN = Pattern
|
||||
.compile("^([A-Za-z]*MOSAIC[0-9]*z)\\.grib$");
|
||||
.compile("^ZETA98_([A-Za-z0-9]*MOSAIC[A-Za-z0-9]*z)_.*\\.grib$");
|
||||
|
||||
@Override
|
||||
public void process(Exchange exchange) throws Exception {
|
||||
|
@ -54,7 +55,7 @@ public class HpeGribFileNameProcessor implements Processor {
|
|||
"CamelFileNameOnly");
|
||||
Matcher matcher = FILENAME_PATTERN.matcher(fileName);
|
||||
if (matcher.matches()) {
|
||||
// Take the text before the last "."
|
||||
// Take the text before the "_"
|
||||
String productName = matcher.group(1);
|
||||
exchange.getIn().setHeader("secondaryid", productName);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue