Search in sources :

Example 1 with FileSystemCachedFile

use of nl.knaw.huygens.timbuctoo.v5.filestorage.implementations.filesystem.dto.FileSystemCachedFile in project timbuctoo by HuygensING.

the class FileSystemFileStorage method getFile.

@Override
public Optional<CachedFile> getFile(String token) throws IOException {
    CachedFile cachedFile = null;
    FileInfo fileInfo = this.fileInfo.getData().getItems().get(token);
    if (fileInfo != null) {
        cachedFile = new FileSystemCachedFile(fileInfo.getMediaType(), fileInfo.getName(), new File(dir, token));
    }
    return Optional.ofNullable(cachedFile);
}
Also used : CachedFile(nl.knaw.huygens.timbuctoo.v5.filestorage.dto.CachedFile) FileSystemCachedFile(nl.knaw.huygens.timbuctoo.v5.filestorage.implementations.filesystem.dto.FileSystemCachedFile) FileSystemCachedFile(nl.knaw.huygens.timbuctoo.v5.filestorage.implementations.filesystem.dto.FileSystemCachedFile) FileInfo(nl.knaw.huygens.timbuctoo.v5.filestorage.implementations.filesystem.dto.FileInfo) CachedFile(nl.knaw.huygens.timbuctoo.v5.filestorage.dto.CachedFile) File(java.io.File) FileSystemCachedFile(nl.knaw.huygens.timbuctoo.v5.filestorage.implementations.filesystem.dto.FileSystemCachedFile)

Aggregations

File (java.io.File)1 CachedFile (nl.knaw.huygens.timbuctoo.v5.filestorage.dto.CachedFile)1 FileInfo (nl.knaw.huygens.timbuctoo.v5.filestorage.implementations.filesystem.dto.FileInfo)1 FileSystemCachedFile (nl.knaw.huygens.timbuctoo.v5.filestorage.implementations.filesystem.dto.FileSystemCachedFile)1