@ Override public File saveAs ( File destFile , boolean overwrite ) throws IOException { if ( destFile == null ) { throw new IllegalArgumentException ( "destFile can not be null" ) ; } validateFile ( ) ; try { destFile = determineDestinationFile ( destFile , overwrite ) ; fileItem . write ( destFile ) ; } catch ( FileUploadException e ) { throw new IllegalStateException ( e . getMessage ( ) ) ; } catch ( Exception e ) { throw new IOException ( "Could not save as file " + destFile , e ) ; } setSavedFile ( destFile ) ; return destFile ; }
Save an uploaded file as a given destination file .