Rev 1378 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1378 | jmachado | 1 | package pt.estgp.estgweb.services.paginasseccoes; |
2 | |||
3 | import jomm.utils.FilesUtils; |
||
4 | import pt.estgp.estgweb.domain.UserSession; |
||
5 | import pt.estgp.estgweb.filters.chains.ResourceAccessControlEnum; |
||
6 | import pt.estgp.estgweb.services.data.RepositoryService; |
||
7 | import pt.estgp.estgweb.web.controllers.paginaseseccoes.PaginasSeccoesForm; |
||
8 | import pt.utl.ist.berserk.logic.serviceManager.IService; |
||
9 | |||
10 | import java.io.IOException; |
||
11 | |||
12 | /** |
||
13 | * Created by jorgemachado on 17/05/16. |
||
14 | */ |
||
15 | public class SalvarFicheiro implements IService |
||
16 | { |
||
17 | public 1.5.0/docs/api/java/lang/String.html">String run(PaginasSeccoesForm frm, UserSession usession) throws 1.5.0/docs/api/java/io/IOException.html">IOException { |
||
18 | RepositoryService service = new RepositoryService(); |
||
19 | 1.5.0/docs/api/java/lang/String.html">String id = service.storeRepositoryFile(frm.getFicheiro().getInputStream(), |
||
20 | frm.getFicheiro().getContentType(), |
||
21 | FilesUtils.getExtension(frm.getFicheiro().getFileName()), |
||
22 | frm.getFicheiro().getFileSize(), |
||
23 | frm.getFicheiro().getFileName(), |
||
24 | "", |
||
25 | ResourceAccessControlEnum.authenticatedDomain, |
||
1703 | jmachado | 26 | null, usession); |
1378 | jmachado | 27 | |
28 | return id; |
||
29 | } |
||
30 | } |