Skip to content
scalive
Menu
ConnectingLiveReconnectingOffline
GitHub
o

LiveUploadAccept

object LiveUploadAccept

Constructors for upload accept policies.

Exported from scalive.upload.LiveUploadAccept. View source (scalive/api/src/scalive/upload/LiveUpload.scala:70-118)

Methods2

only

def only(first: String, rest: String*): LiveUploadAccept

Creates a policy containing one or more file extensions or media types.

Leading and trailing whitespace is removed from every filter. Extensions start with ., while media filters contain one non-edge / and may use a wildcard subtype, for example any image type. This is deliberately shallow syntax validation rather than complete MIME parsing. Preflight lowercases filters and browser-reported values before matching.

Throws

IllegalArgumentException

if a filter is blank or does not match the shallow extension/media grammar, or if trimmed filters contain a case-sensitive exact duplicate

Exported from scalive.upload.LiveUploadAccept.only. View source (scalive/api/src/scalive/upload/LiveUpload.scala:86-87)

validated

def validated(values: Iterable[String]): Either[IllegalArgumentException, LiveUploadAccept]

Validates and creates an accept policy without throwing.

The input must contain at least one filter. Filters are trimmed, must remain non-empty and unique by case-sensitive equality, and must be either an extension beginning with . or a media-like value containing exactly one non-leading, non-trailing /. No complete MIME syntax validation is performed.

Exported from scalive.upload.LiveUploadAccept.validated. View source (scalive/api/src/scalive/upload/LiveUpload.scala:96-108)