Skip to content

Commit

Permalink
[Fixes JIRA GEOS-8756] [Importer] ImportJSONWriter failing due to mis…
Browse files Browse the repository at this point in the history
…sing consistency checks on 'location' when 'expand>0'
  • Loading branch information
Alessio Fabiani committed May 29, 2018
1 parent 5729bcf commit 95237a4
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,15 @@ public void file(FlushableJSONBuilder json,FileData data, Object parent, int exp
json.key("href").value(RequestInfo.get().servletURI(pathTo(data, parent)));
}

String location = null;
try {
location = data.getFile().getParentFile().getPath();
} catch(Exception e) {
location = "";
}

if (expand > 0) {
json.key("location").value(data.getFile().getParentFile().getPath());
json.key("location").value(location);
if (data.getCharsetEncoding() != null) {
json.key("charset").value(data.getCharsetEncoding());
}
Expand Down

0 comments on commit 95237a4

Please sign in to comment.