fix dict download

This commit is contained in:
Kaoru FUZITA 2015-11-09 11:11:34 +09:00
parent 9e052b2fa1
commit b6909eb7bd
4 changed files with 4 additions and 4 deletions

View file

@ -207,7 +207,7 @@ public class AdminDictKuromojiAction extends FessAdminAction {
public ActionResponse download(final DownloadForm form) {
validate(form, messages -> {}, () -> downloadpage(form.dictId));
return kuromojiService.getKuromojiFile(form.dictId).map(file -> {
return asStream(new File(file.getPath()).getName()).contentType("text/plain; charset=UTF-8").stream(out -> {
return asStream(new File(file.getPath()).getName()).stream(out -> {
try (InputStream inputStream = file.getInputStream()) {
out.write(inputStream);
}

View file

@ -238,7 +238,7 @@ public class AdminDictSynonymAction extends FessAdminAction {
public ActionResponse download(final DownloadForm form) {
validate(form, messages -> {}, () -> downloadpage(form.dictId));
return synonymService.getSynonymFile(form.dictId).map(file -> {
return asStream(new File(file.getPath()).getName()).contentType("text/plain; charset=UTF-8").stream(out -> {
return asStream(new File(file.getPath()).getName()).stream(out -> {
try (InputStream inputStream = file.getInputStream()) {
out.write(inputStream);
}

View file

@ -72,7 +72,7 @@
</la:info>
<la:errors />
</div>
<la:form target="_blank">
<la:form>
<div>
<la:hidden property="dictId" />
<table class="table table-bordered table-striped">

View file

@ -72,7 +72,7 @@
</la:info>
<la:errors />
</div>
<la:form target="_blank">
<la:form>
<div>
<la:hidden property="dictId" />
<table class="table table-bordered table-striped">