Issue #3026 - Fixed pattern to match the actual file names

Change-Id: I957e2076cfa5ee4d59acc1a0db89066e446bfc99

Former-commit-id: edb85525d0 [formerly 9be37bb41e] [formerly f841f1eda9 [formerly 5a3ccbadbf08957a4f68a0cb7118c765ca44f849]]
Former-commit-id: f841f1eda9
Former-commit-id: f1c4463316
This commit is contained in:
Mike Duff 2014-11-18 13:40:26 -06:00
parent da8130d7be
commit 1f1436a0da

View file

@ -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);
}