Author: ssthkjer
Date: 2007-01-17 10:29:40 +0100 (Wed, 17 Jan 2007)
New Revision: 4341
Modified:
trunk/core-api/src/main/java/no/schibstedsok/searchportal/result/handler/FindFileFormat.java
Log:
find uppercase formats too
Modified:
trunk/core-api/src/main/java/no/schibstedsok/searchportal/result/handler/FindFileFormat.java
===================================================================
---
trunk/core-api/src/main/java/no/schibstedsok/searchportal/result/handler/FindFileFormat.java
2007-01-17 09:09:58 UTC (rev 4340)
+++
trunk/core-api/src/main/java/no/schibstedsok/searchportal/result/handler/FindFileFormat.java
2007-01-17 09:29:40 UTC (rev 4341)
@@ -21,16 +21,16 @@
final String url = item.getField("url");
//print out the following fileformats after title
- if (url.endsWith(".pdf"))
- item.addField("fileformat", "[pdf]");
- else if (url.endsWith(".doc"))
- item.addField("fileformat", "[word]");
- else if (url.endsWith(".ppt"))
- item.addField("fileformat", "[power point]");
- else if (url.endsWith(".xls"))
- item.addField("fileformat", "[excel]");
- else if (url.endsWith(".txt"))
- item.addField("fileformat", "[txt]");
+ if (url.toLowerCase().endsWith(".pdf"))
+ item.addField("fileformat", "[pdf]");
+ else if (url.toLowerCase().endsWith(".doc"))
+ item.addField("fileformat", "[word]");
+ else if (url.toLowerCase().endsWith(".ppt"))
+ item.addField("fileformat", "[power point]");
+ else if (url.toLowerCase().endsWith(".xls"))
+ item.addField("fileformat", "[excel]");
+ else if (url.toLowerCase().endsWith(".txt"))
+ item.addField("fileformat", "[txt]");
}
}
_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits