class StorageFileDaoHelper {

    public List<StorageFileEntity> createStorageFileEntitiesFromStorageFiles(StorageUnitEntity storageUnitEntity, List<StorageFile> storageFiles)
    {
        List<StorageFileEntity> storageFileEntities = new ArrayList<>();

        for (StorageFile storageFile : storageFiles)
        {
            StorageFileEntity storageFileEntity = new StorageFileEntity();
            storageFileEntities.add(storageFileEntity);
            storageFileEntity.setStorageUnit(storageUnitEntity);
            storageFileEntity.setPath(storageFile.getFilePath());
            storageFileEntity.setFileSizeBytes(storageFile.getFileSizeBytes());
            storageFileEntity.setRowCount(storageFile.getRowCount());
        }

        storageFileDao.saveStorageFiles(storageFileEntities);

        return storageFileEntities;
    }

}