FileUpstreamDao

class FileUpstreamDao(workingDir: File) : IUpstreamDao

Implementation of IUpstreamDao that store the session in the file system.

The session is stored in a directory named with the session id and contains the following files:

  • videoId: contains the video id

  • token: contains the token

  • lastPart: contains the index of the last part uploaded

  • parts: contains the list of parts uploaded

    • 1: contains the URL of part 1

    • 2: contains the URL of part 2

Parameters

workingDir

The working directory

Constructors

Link copied to clipboard
fun FileUpstreamDao(workingDir: File)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun getById(sessionId: String): UpstreamSessionEntity?
Link copied to clipboard
open override fun getByToken(token: String, videoId: String?): List<UpstreamSessionEntity>
Link copied to clipboard
open override fun getByVideoId(videoId: String): UpstreamSessionEntity?
Link copied to clipboard
open override fun getLastPartId(sessionId: String): Int?
Link copied to clipboard
open override fun getParts(sessionId: String): List<Part>
Link copied to clipboard
open override fun hasParts(sessionId: String): Boolean
Link copied to clipboard
open override fun insert(sessionId: String)
Link copied to clipboard
open override fun insertPart(sessionId: String, part: Part)

Insert a part of the session If the part is the last part, the last part id have to be insert.

Link copied to clipboard
open override fun insertToken(sessionId: String, token: String)
Link copied to clipboard
open override fun insertVideoId(sessionId: String, videoId: String)
Link copied to clipboard
open override fun remove(sessionId: String)
Link copied to clipboard
open override fun removePart(sessionId: String, partIndex: Int)

Properties

Link copied to clipboard
open override val allSessions: List<UpstreamSessionEntity>