org.appng.api

## Annotation Type FileUpload

-     @Target(value={METHOD,FIELD})
       @Retention(value=RUNTIME)
       @Documented
       @Constraint(validatedBy={FileUploadValidator.class,FileUploadListValidator.class})
      public @interface FileUpload

  Used to validate the size, filetype(s) and amount of a (`Collection`) of) `FormUpload`(s).
  Author:
    Matthias Müller

- - ### Field Summary

    Fields
    Modifier and Type | Fields and Description
    --- | ---
    `static int` | `FACTOR`

  - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `String` | `fileTypes`
    `Class<?>[]` | `groups`
    `int` | `maxCount`
    `long` | `maxSize`
    `String` | `message`
    `int` | `minCount`
    `long` | `minSize`
    `Class<? extends javax.validation.Payload>[]` | `payload`
    `FileUpload.Unit` | `unit`
    `Class<? extends FormUploadValidator>[]` | `uploadValidators`

- - ### Field Detail

    - #### FACTOR

          public static final int FACTOR

  - ### Element Detail

    - #### message

          public abstract String message

      Default:
        "{validation.file.invalid}"

  - - #### groups

          public abstract Class<?>[] groups

      Default:
        {}

  - - #### payload

          public abstract Class<? extends javax.validation.Payload>[] payload

      Default:
        {}

  - - #### uploadValidators

          public abstract Class<? extends FormUploadValidator>[] uploadValidators

      Returns:
        an array of `FormUploadValidator`s for additional validation of a `FormUpload`.
      Default:
        {}

  - - #### minSize

          public abstract long minSize

      Returns:
        the minimum size for an uploaded file (default: 0 `unit()`)
      See Also:
        `unit()`
      Default:
        0L

  - - #### maxSize

          public abstract long maxSize

      Returns:
        the maximum size for an uploaded file (default: 10 `unit()`)
      See Also:
        `unit()`
      Default:
        10L

  - - #### unit

          public abstract FileUpload.Unit unit

      Returns:
        the `FileUpload.Unit` for `minSize()` and `maxSize()` (default: `FileUpload.Unit.MB`)
      Default:
        org.appng.api.FileUpload.Unit.MB

  - - #### minCount

          public abstract int minCount

      Returns:
        the minimum number of uploaded files (default: 1)
      Default:
        1

  - - #### maxCount

          public abstract int maxCount

      Returns:
        the maximum number of uploaded files (default: 1)
      Default:
        1

  - - #### fileTypes

          public abstract String fileTypes

      Returns:
        a comma-separated list of allowed file-extensions (default "", which means everything is allowed)
      Default:
        ""

Copyright © 2011–2023 aiticon GmbH. All rights reserved.