Ticket #323 (closed task: fixed)
Representation.setDownloadable is deprecated
| Reported by: | dd | Owned by: | jgou |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | core/kauri-runtime | Version: | trunk |
| Keywords: | representation deprecated disposition | Cc: | kauri-discuss@… |
Description
The lines
rep.setDownloadable(true); rep.setDownloadName(fileInfo.getFileName());
should be replaced with the disposition class. However i cannot get it to work.
Disposition disposition = new Disposition(Disposition.TYPE_ATTACHMENT);
disposition.setFilename(fileInfo.getFileName());
disposition.setCreationDate(fileInfo.getCreateTime()); disposition.setModificationDate(fileInfo.getCreateTime()); disposition.setReadDate(fileInfo.getCreateTime()); disposition.setSize(fileContent.length);
Change History
comment:2 in reply to: ↑ 1 Changed 3 years ago by jgou
Replying to jgou:
I tried the fragment below, without problems:
Please elaborate: what does not work in your case, which error do you receive ?
after offline debate: the real problem was not related to this issue
comment:3 Changed 3 years ago by jgou
- Status changed from new to closed
- Resolution set to fixed
[1537] : updated references in kauri codebase to use disposition instead
Added info to "Restlet upgrade" documentation
I tried the fragment below, without problems:
Disposition disposition = new Disposition(Disposition.TYPE_ATTACHMENT); disposition.setFilename("testdownload.txt"); Date date = new Date(); disposition.setCreationDate(date); disposition.setModificationDate(date); disposition.setReadDate(date); disposition.setSize(length); representation.setDisposition(disposition);Please elaborate: what does not work in your case, which error do you receive ?