This project is read-only.
1
Vote

Overwrite false on GetFile

description

If there is no file and overwrite is false on GetFile() an Exception is thrown:
        if (!File.Exists(LocalFileName)) {
            if (Overwrite) {
                System.IO.File.Delete(LocalFileName);
            } else {
                throw new FTPException("Local File already exists");
            }
        }
 
I modified the block to :
        bool fileExists = File.Exists(LocalFileName);
        if (Overwrite && fileExists) {
            System.IO.File.Delete(LocalFileName);
        } else if (!Overwrite && fileExists) {
            throw new FTPException("Local File already exists");
        }

comments