-
Notifications
You must be signed in to change notification settings - Fork 284
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
Making languages dynamic with command arguments #125
Changes from 16 commits
00933ac
68ae44f
0621d01
35bcfde
e9fda4b
dacb243
84a37c2
a7ac5eb
0636de8
b4c5d42
b7e6ff3
fee73da
41ee0d1
d81292a
756aeb2
f3332f7
0b7f608
e4c6a6e
0c82ecb
d586d52
80116a9
8b67963
1a50011
c4726f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,7 @@ dependency-reduced-pom.xml | |
*.~* | ||
|
||
__pycache__ | ||
|
||
nb-configuration.xml | ||
|
||
nbactions.xml |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ | |
|
||
import com.google.common.base.Joiner; | ||
import de.komoot.photon.importer.elasticsearch.Searcher; | ||
import org.elasticsearch.common.collect.ImmutableSet; | ||
import java.util.Arrays; | ||
import java.util.HashSet; | ||
import org.json.JSONArray; | ||
import org.json.JSONObject; | ||
import spark.Request; | ||
|
@@ -19,11 +20,12 @@ | |
*/ | ||
public class RequestHandler extends Route { | ||
private final Searcher searcher; | ||
private static final Set<String> supportedLanguages = ImmutableSet.of("de", "en", "fr", "it"); | ||
|
||
protected RequestHandler(String path, Searcher searcher) { | ||
private final Set<String> supportedLanguages; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see spaces here, while the lines around have tabs, but I'm not sure what's the choice here. @christophlingg? :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably a formatting setting of the Netbeans config I use. I will change it to tabs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Spaces still seem to be there ;) |
||
protected RequestHandler(String path, Searcher searcher, String languages) { | ||
super(path); | ||
this.searcher = searcher; | ||
this.supportedLanguages = new HashSet<String>(Arrays.asList(languages.split(","))); | ||
} | ||
|
||
@Override | ||
|
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.
What about just
-languages
?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.
Simple and to the point, much better 👍