public static void updateFileFromFile ( final File sourceFile , final String destinationFilePath ) throws UpdateException { if ( ! sourceFile . exists ( ) ) { throw new UpdateException ( "Source file does not exist: " + sourceFile ) ; } if ( ! sourceFile . isFile ( ) ) { throw new UpdateException ( "Not a file: " + sourceFile ) ; } if ( sourceFile . length ( ) < 1 ) { throw new UpdateException ( "Source file is empty: " + sourceFile ) ; } try { updateFileFromInputStream ( new FileInputStream ( sourceFile ) , destinationFilePath ) ; } catch ( IOException e ) { throw new UpdateException ( "Unable to update file: " + e . getMessage ( ) , e ) ; } }
Get the source File and store it to a destination file path