TripalCultivate/TripalCultivate-Phenotypes

G4.47 Data File Validator

reynoldtan opened this issue · 1 comments

Branch

g4.47-Data-file-validator

Groups

Group 4 - API | Services | Plugins

Describe

Create a validator plugin that validates Data File for

  1. Is not empty/0 file id.
  2. Has Drupal File Id assigned/created.
  3. File Id can loaded using Drupal file system API.
  4. A valid TSV or TXT file extension and file MIME type.
  5. File size is greater than 0.
  6. File can be opened/read.

Design

Similar to other validator plugin, this method will implement validator plugin with the following method().

public function validate() {
   Check file id is > 0
   
   Load file id
   Check if file can be loaded through Drupal File API
   Use MIME information of the file to validate file type.
   Use the File size information to validate file size is > 0
  
   Open/Read File 
   Check if file can be opened/read
}

Completed with above merged PR