@Service @Transactional public class FileService extends Object
| Constructor and Description |
|---|
FileService(FileRepository fileRepository) |
| Modifier and Type | Method and Description |
|---|---|
File |
createFile(FileType type,
String name,
User owner)
Create a new file
|
void |
delete(Long id)
Delete the file by id.
|
org.springframework.data.domain.Page<File> |
findAll(org.springframework.data.domain.Pageable pageable)
Get all the files.
|
List<File> |
findByOwnerIsCurrentUser(String login,
FileType type)
Get all the files owned by this user, plus all shared files.
|
List<File> |
findByOwnerIsCurrentUserOrShared(String login,
FileType type)
Get all the files owned by this user, plus all shared files.
|
File |
findOne(Long id)
Get one file by id.
|
File |
save(File file)
Save a file.
|
public FileService(FileRepository fileRepository)
public File save(File file)
file - the entity to save@Transactional(readOnly=true) public org.springframework.data.domain.Page<File> findAll(org.springframework.data.domain.Pageable pageable)
pageable - the pagination information@Transactional(readOnly=true) public List<File> findByOwnerIsCurrentUser(String login, FileType type)
@Transactional(readOnly=true) public List<File> findByOwnerIsCurrentUserOrShared(String login, FileType type)
@Transactional(readOnly=true) public File findOne(Long id)
id - the id of the entitypublic void delete(Long id)
id - the id of the entityCopyright © 2017 Power TAC. All rights reserved.