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