Craig Oates
6 years ago
4 changed files with 17 additions and 6 deletions
@ -1,9 +1,20 @@
|
||||
module internal Validation |
||||
|
||||
open System.IO |
||||
open System.IO |
||||
|
||||
let validateFilePath path = |
||||
match File.Exists path with |
||||
| true -> () |
||||
| false -> raise (new FileNotFoundException (path + " could not be found.")) |
||||
|
||||
let validatFileType file = |
||||
match Path.GetExtension file with |
||||
| ".bmp" -> () |
||||
| ".BMP" -> () |
||||
| ".jpg" -> () |
||||
| ".JPG" -> () |
||||
| ".png" -> () |
||||
| ".PNG" -> () |
||||
| ".tif" -> () |
||||
| ".TIF" -> () |
||||
| _ -> invalidArg "savePath" "The file type must be a .bmp, .jpg, .png or .tif file." |
Loading…
Reference in new issue