@Test void processFileContent() throws Exception { FileEntry fileEntry = addFile(TEST_FILE_LOCATION); String testFileDigest = DigestHelper.computeFileChecksum(Paths.get(TEST_FILE_LOCATION), DIGEST_METHOD) .toLowerCase(); validateFileContent(fileEntry, testFileDigest); }
@Override public <T> T processFileContent(String space, String id, FileContentProcessor<T> fileContentProcessor) throws FileStorageException { FileEntry fileEntry = createFileEntry(space, id); try { Blob blob = getBlobWithRetries(fileEntry, 3); if (blob == null) { throw new FileStorageException(MessageFormat.format(Messages.FILE_WITH_ID_AND_SPACE_DOES_NOT_EXIST, fileEntry.getId(), fileEntry.getSpace())); } Payload payload = blob.getPayload(); return processContent(fileContentProcessor, payload); } catch (Exception e) { throw new FileStorageException(e); } }
ObjectStoreFileStorage implements FileStorage { @Override public <T> T processFileContent(String space, String id, FileContentProcessor<T> fileContentProcessor) throws FileStorageException { FileEntry fileEntry = createFileEntry(space, id); try { Blob blob = getBlobWithRetries(fileEntry, 3); if (blob == null) { throw new FileStorageException(MessageFormat.format(Messages.FILE_WITH_ID_AND_SPACE_DOES_NOT_EXIST, fileEntry.getId(), fileEntry.getSpace())); } Payload payload = blob.getPayload(); return processContent(fileContentProcessor, payload); } catch (Exception e) { throw new FileStorageException(e); } } }
ObjectStoreFileStorage implements FileStorage { @Override public <T> T processFileContent(String space, String id, FileContentProcessor<T> fileContentProcessor) throws FileStorageException { FileEntry fileEntry = createFileEntry(space, id); try { Blob blob = getBlobWithRetries(fileEntry, 3); if (blob == null) { throw new FileStorageException(MessageFormat.format(Messages.FILE_WITH_ID_AND_SPACE_DOES_NOT_EXIST, fileEntry.getId(), fileEntry.getSpace())); } Payload payload = blob.getPayload(); return processContent(fileContentProcessor, payload); } catch (Exception e) { throw new FileStorageException(e); } } ObjectStoreFileStorage(BlobStore blobStore, String container); }
ObjectStoreFileStorage implements FileStorage { @Override public <T> T processFileContent(String space, String id, FileContentProcessor<T> fileContentProcessor) throws FileStorageException { FileEntry fileEntry = createFileEntry(space, id); try { Blob blob = getBlobWithRetries(fileEntry, 3); if (blob == null) { throw new FileStorageException(MessageFormat.format(Messages.FILE_WITH_ID_AND_SPACE_DOES_NOT_EXIST, fileEntry.getId(), fileEntry.getSpace())); } Payload payload = blob.getPayload(); return processContent(fileContentProcessor, payload); } catch (Exception e) { throw new FileStorageException(e); } } ObjectStoreFileStorage(BlobStore blobStore, String container); @Override void addFile(FileEntry fileEntry, File file); @Override List<FileEntry> getFileEntriesWithoutContent(List<FileEntry> fileEntries); @Override void deleteFile(String id, String space); @Override void deleteFilesBySpace(String space); @Override void deleteFilesBySpaceAndNamespace(String space, String namespace); @Override int deleteFilesModifiedBefore(Date modificationTime); @Override T processFileContent(String space, String id, FileContentProcessor<T> fileContentProcessor); }
ObjectStoreFileStorage implements FileStorage { @Override public <T> T processFileContent(String space, String id, FileContentProcessor<T> fileContentProcessor) throws FileStorageException { FileEntry fileEntry = createFileEntry(space, id); try { Blob blob = getBlobWithRetries(fileEntry, 3); if (blob == null) { throw new FileStorageException(MessageFormat.format(Messages.FILE_WITH_ID_AND_SPACE_DOES_NOT_EXIST, fileEntry.getId(), fileEntry.getSpace())); } Payload payload = blob.getPayload(); return processContent(fileContentProcessor, payload); } catch (Exception e) { throw new FileStorageException(e); } } ObjectStoreFileStorage(BlobStore blobStore, String container); @Override void addFile(FileEntry fileEntry, File file); @Override List<FileEntry> getFileEntriesWithoutContent(List<FileEntry> fileEntries); @Override void deleteFile(String id, String space); @Override void deleteFilesBySpace(String space); @Override void deleteFilesBySpaceAndNamespace(String space, String namespace); @Override int deleteFilesModifiedBefore(Date modificationTime); @Override T processFileContent(String space, String id, FileContentProcessor<T> fileContentProcessor);  }