Product Information > JADE Error Messages and System Messages > 5000 through 5099 - File Handling Errors > 5008 - Cannot overwrite existing file

5008   Cannot overwrite existing file

Cause

This error occurs if an attempt is made to overwrite an existing file when opening a file with a mode set to File.Mode_Output and the allowReplace attribute of the File class is set to false.

The allowReplace attribute is intended to prevent the accidental overwriting of existing files.

Action

Determine if the existing file is still required. If it is required, move, rename, or back up and remove the file, and then repeat the operation. If it is not required, remove the file and repeat the operation. Alternatively, provide an appropriate exception handler to shield users from this error.