From bd1685c94a07515700ed4da5ecd9c6171c902755 Mon Sep 17 00:00:00 2001 From: reger Date: Wed, 5 Feb 2014 03:45:02 +0100 Subject: [PATCH] fix not needed getFileExtension().toLower (double) add missing .getFileExtension --- htroot/yacysearchitem.java | 2 +- .../cora/federate/solr/responsewriter/YJsonResponseWriter.java | 2 +- source/net/yacy/document/TextParser.java | 3 +-- source/net/yacy/document/parser/tarParser.java | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/htroot/yacysearchitem.java b/htroot/yacysearchitem.java index 45e60f18b..731c5b743 100644 --- a/htroot/yacysearchitem.java +++ b/htroot/yacysearchitem.java @@ -244,7 +244,7 @@ public class yacysearchitem { prop.put("content_heuristic_name", heuristic.heuristicName); } EventTracker.update(EventTracker.EClass.SEARCH, new ProfilingGraph.EventSearch(theSearch.query.id(true), SearchEventType.FINALIZATION, "" + item, 0, 0), false); - final String ext = MultiProtocolURL.getFileExtension(resultFileName).toLowerCase(); + final String ext = MultiProtocolURL.getFileExtension(resultFileName); if (MultiProtocolURL.isImage(ext)) { final String license = URLLicense.aquireLicense(resultURL); prop.put("content_code", license); diff --git a/source/net/yacy/cora/federate/solr/responsewriter/YJsonResponseWriter.java b/source/net/yacy/cora/federate/solr/responsewriter/YJsonResponseWriter.java index 16e4eab90..2e73fb87e 100644 --- a/source/net/yacy/cora/federate/solr/responsewriter/YJsonResponseWriter.java +++ b/source/net/yacy/cora/federate/solr/responsewriter/YJsonResponseWriter.java @@ -158,7 +158,7 @@ public class YJsonResponseWriter implements QueryResponseWriter { solitaireTag(writer, "link", u); solitaireTag(writer, "file", filename); // get image license - if (MultiProtocolURL.isImage(filename)) URLLicense.aquireLicense(urlhash, url.toNormalform(true)); + if (MultiProtocolURL.isImage(MultiProtocolURL.getFileExtension(filename))) URLLicense.aquireLicense(urlhash, url.toNormalform(true)); } catch (final MalformedURLException e) {} continue; } diff --git a/source/net/yacy/document/TextParser.java b/source/net/yacy/document/TextParser.java index 8e8a153f2..1f867ec9c 100644 --- a/source/net/yacy/document/TextParser.java +++ b/source/net/yacy/document/TextParser.java @@ -368,7 +368,6 @@ public final class TextParser { String ext = MultiProtocolURL.getFileExtension(url.getFileName()); Set idiom; if (ext != null && ext.length() > 0) { - ext = ext.toLowerCase(); if (denyExtensionx.containsKey(ext)) throw new Parser.Failure("file extension '" + ext + "' is denied (1)", url); idiom = ext2parser.get(ext); if (idiom != null) idioms.addAll(idiom); @@ -431,7 +430,7 @@ public final class TextParser { * @return an error if the extension is not supported, null otherwise */ public static String supportsExtension(final MultiProtocolURL url) { - return supportsExtension(MultiProtocolURL.getFileExtension(url.getFileName()).toLowerCase()); + return supportsExtension(MultiProtocolURL.getFileExtension(url.getFileName())); } public static String mimeOf(final MultiProtocolURL url) { diff --git a/source/net/yacy/document/parser/tarParser.java b/source/net/yacy/document/parser/tarParser.java index c15737bcd..86ded03dd 100644 --- a/source/net/yacy/document/parser/tarParser.java +++ b/source/net/yacy/document/parser/tarParser.java @@ -65,7 +65,7 @@ public class tarParser extends AbstractParser implements Parser { final List docacc = new ArrayList(); Document[] subDocs = null; - final String ext = MultiProtocolURL.getFileExtension(url.getFileName()).toLowerCase(); + final String ext = MultiProtocolURL.getFileExtension(url.getFileName()); if (ext.equals("gz") || ext.equals("tgz")) { try { source = new GZIPInputStream(source);