Craig Oates
6 years ago
4 changed files with 17 additions and 6 deletions
@ -1,9 +1,20 @@ |
|||||||
module internal Validation |
module internal Validation |
||||||
|
|
||||||
open System.IO |
open System.IO |
||||||
|
|
||||||
let validateFilePath path = |
let validateFilePath path = |
||||||
match File.Exists path with |
match File.Exists path with |
||||||
| true -> () |
| true -> () |
||||||
| false -> raise (new FileNotFoundException (path + " could not be found.")) |
| 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