-
Notifications
You must be signed in to change notification settings - Fork 299
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
Enable custom Tika Parser #498
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
2ae845f
Try to resolve conflict before overwrite from origin
jevertz 28482c8
Example Tika configuration file.
jevertz f7e2b1a
allow custom Tika parser
jevertz 1a0f5f6
After rebase. Added support for a custom external Tika Parser.
jevertz 224f22e
Extended README to cover custom tika parsers setting
jevertz 5c4b88d
Try to resolve conflict before overwrite from origin
jevertz 43e42aa
Example Tika configuration file.
jevertz 4e9cd5b
allow custom Tika parser
jevertz 456104c
After rebase. Added support for a custom external Tika Parser.
jevertz ed528b2
Extended README to cover custom tika parsers setting
jevertz 05a609a
Implemented change requests
jevertz 36b0ee0
Merge remote-tracking branch 'origin/master'
jevertz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
settings/src/main/java/fr/pilato/elasticsearch/crawler/fs/settings/CustomTikaParser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
package fr.pilato.elasticsearch.crawler.fs.settings; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class CustomTikaParser { | ||
|
||
private String className = ""; | ||
private String pathToJar = ""; | ||
private ArrayList<String> mimeTypes = new ArrayList<String>(); | ||
|
||
public static Builder builder() { | ||
return new Builder(); | ||
} | ||
|
||
public static class Builder { | ||
|
||
private String className = ""; | ||
private String pathToJar = ""; | ||
private ArrayList<String> mimeTypes = new ArrayList<String>(); | ||
|
||
public Builder setClassName(String className) { | ||
this.className = className; | ||
return this; | ||
} | ||
|
||
public Builder setPathToJar(String pathToJar) { | ||
this.pathToJar = pathToJar; | ||
return this; | ||
} | ||
|
||
public Builder setMimeTypes(ArrayList<String> mimeTypes) { | ||
this.mimeTypes = mimeTypes; | ||
return this; | ||
} | ||
|
||
public CustomTikaParser build() { | ||
return new CustomTikaParser(className, pathToJar, mimeTypes); | ||
} | ||
} | ||
|
||
public CustomTikaParser() { | ||
|
||
} | ||
|
||
private CustomTikaParser(String className, String pathToJar, ArrayList<String> mimeTypes) { | ||
|
||
this.className = className; | ||
this.pathToJar = pathToJar; | ||
this.mimeTypes = mimeTypes; | ||
} | ||
|
||
public String getClassName() { | ||
return className; | ||
} | ||
|
||
public void setClassName(String className) { | ||
this.className = className; | ||
} | ||
|
||
public String getPathToJar() { | ||
return pathToJar; | ||
} | ||
|
||
public void setPathToJar(String pathToJar) { | ||
this.pathToJar = pathToJar; | ||
} | ||
|
||
public List<String> getMimeTypes() { | ||
return mimeTypes; | ||
} | ||
|
||
public void setMimeTypes(ArrayList<String> mimeTypes) { | ||
this.mimeTypes = mimeTypes; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
|
||
CustomTikaParser ctp = (CustomTikaParser) o; | ||
|
||
if (className != null ? !className.equals(ctp.className) : ctp.className != null) return false; | ||
if (pathToJar != null ? !pathToJar.equals(ctp.pathToJar) : ctp.pathToJar != null) return false; | ||
return mimeTypes != null ? mimeTypes.equals(ctp.mimeTypes) : ctp.mimeTypes == null; | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ES Core -> FSCrawler Core ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied the excludes from fscrawler's root pom.xml. The line is still there at the time of this writing. Can it be removed, perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true. Just remove it here but I will also remove this in the future from the main
pom.xml
indeed.