fix not needed getFileExtension().toLower (double)

add missing .getFileExtension
pull/1/head
reger 11 years ago
parent a11f072504
commit bd1685c94a

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

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

@ -368,7 +368,6 @@ public final class TextParser {
String ext = MultiProtocolURL.getFileExtension(url.getFileName());
Set<Parser> 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) {

@ -65,7 +65,7 @@ public class tarParser extends AbstractParser implements Parser {
final List<Document> docacc = new ArrayList<Document>();
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);

Loading…
Cancel
Save