public class FileServiceDisk extends Object implements FileService
| Constructor and Description |
|---|
FileServiceDisk(FileDaoDiskQuerydsl fileDao,
FileTypesProvider fileTypesProvider,
FileConfigurationService configurationService,
ChecksumService checksumService) |
| Modifier and Type | Method and Description |
|---|---|
void |
delete(Long fileId) |
void |
deleteUnreferenced() |
Optional<FileData> |
fetch(Long fileId) |
FileUploaded |
upload(FileType fileType,
byte[] fileData,
String filename)
Save an uploaded file.
|
Optional<String> |
url(Long fileId)
Returns a complete relative URL, for example /api/files/3418557718705733633/cats.jpg
Optional.empty() is returned if the corresponding file does not exist |
String |
urlRaw(Long fileId)
Returns a relative URL without the extension.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitupload, upload, upload, uploadprotected String path
@Inject public FileServiceDisk(FileDaoDiskQuerydsl fileDao, FileTypesProvider fileTypesProvider, FileConfigurationService configurationService, ChecksumService checksumService)
public FileUploaded upload(FileType fileType, byte[] fileData, @Nullable String filename)
FileServiceupload in interface FileServicepublic void delete(Long fileId)
delete in interface FileServicepublic void deleteUnreferenced()
deleteUnreferenced in interface FileServicepublic Optional<String> url(Long fileId)
FileServiceOptional.empty() is returned if the corresponding file does not existurl in interface FileServicepublic String urlRaw(Long fileId)
FileServiceFileService.url(Long),
it does not make a call to the database to compute the file URL.
For example, returns /api/file/3418557718705733633urlRaw in interface FileServicepublic Optional<FileData> fetch(Long fileId)
fetch in interface FileServiceCopyright © 2018 Coreoz. All rights reserved.