Skip to content

Commit

Permalink
increasing ease of use
Browse files Browse the repository at this point in the history
showMetadata = true|false is now also valid
the showMetadata and types parameters can be written in upper and lower case
  • Loading branch information
kowatsch committed May 11, 2018
1 parent cbdb292 commit 469b031
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ else if (DbConnData.igniteDb == null)
}
if (showMetadata == null)
this.showMetadata = false;
else if (showMetadata.equals("true"))
else if (showMetadata.equalsIgnoreCase("true") || showMetadata.equalsIgnoreCase("yes"))
this.showMetadata = true;
else if (showMetadata.equals("false") || showMetadata.equals(""))
else if (showMetadata.equalsIgnoreCase("false") || showMetadata.equals("") || showMetadata.equalsIgnoreCase("no"))
this.showMetadata = false;
else
throw new BadRequestException(
"The showMetadata parameter can only contain the values 'true' or 'false' written as text(String).");
"The showMetadata parameter can only contain the values 'true', 'yes', 'false' or 'no' written as text(String).");
checkBoundaryParams(bboxes, bcircles, bpolys);
try {
switch (boundary) {
Expand Down Expand Up @@ -194,7 +194,7 @@ private void checkBoundaryParams(String bboxes, String bcircles, String bpolys)
* @throws BadRequestException if the content of the parameter does not represent one, two, or all
* three OSM types
*/
private EnumSet<OSMType> checkTypes(String[] types) throws BadRequestException {
public EnumSet<OSMType> checkTypes(String[] types) throws BadRequestException {
if (types.length > 3) {
throw new BadRequestException(
"Parameter 'types' containing the OSM Types cannot have more than 3 entries.");
Expand All @@ -204,11 +204,11 @@ private EnumSet<OSMType> checkTypes(String[] types) throws BadRequestException {
} else {
this.osmTypes = EnumSet.noneOf(OSMType.class);
for (String type : types) {
if (type.equals("node"))
if (type.equalsIgnoreCase("node"))
this.osmTypes.add(OSMType.NODE);
else if (type.equals("way"))
else if (type.equalsIgnoreCase("way"))
this.osmTypes.add(OSMType.WAY);
else if (type.equals("relation"))
else if (type.equalsIgnoreCase("relation"))
this.osmTypes.add(OSMType.RELATION);
else
throw new BadRequestException(
Expand Down

0 comments on commit 469b031

Please sign in to comment.