Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Tika dependency #198

Merged
merged 2 commits into from Apr 2, 2018
Merged

Remove Tika dependency #198

merged 2 commits into from Apr 2, 2018

Conversation

kkrugler
Copy link
Contributor

Quick attempt at replacing Tika-based mime-type detection with simple code.

I assume that sitemaps are UTF-8, thus no need to handle UTF-16LE/BE encoded BOMs when detecting patterns.

@kkrugler kkrugler self-assigned this Mar 27, 2018
}
throw new UnknownFormatException("Can't parse a gzipped sitemap with the embedded MediaType of: " + embeddedType + " (at: " + url + ")");
} catch (Exception e) {
String msg = String.format("Failed to detect embedded MediaType of gzipped sitemap '%s'", url);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use explicit locale?
The forbidden API complains otherwise

[ERROR] Forbidden method invocation: java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses default locale]
[ERROR]   in crawlercommons.sitemaps.SiteMapParser (SiteMapParser.java:232)
[ERROR] Forbidden method invocation: java.lang.String#format(java.lang.String,java.lang.Object[]) [Uses default locale]
[ERROR]   in crawlercommons.sitemaps.SiteMapParser (SiteMapParser.java:237)

Copy link
Contributor

@sebastian-nagel sebastian-nagel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 No regressions on around 50,000 sitemaps.

Ev. could run mvn java-formatter:format.

@kkrugler kkrugler merged commit 14153c4 into master Apr 2, 2018
@kkrugler kkrugler deleted the kkrugler_no-tika branch April 2, 2018 19:55
@sebastian-nagel
Copy link
Contributor

Sorry, you can call me a fool but I've run the large tests on the wrong version of crawler-commons (didn't update the dependency to 0.10-SNAPSHOT). There are a couple of regressions, but nothing serious. Opened #200 to fix these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants