Source:
<code>public static void createMockFile(String filePathToRead, String filePathToCreate, int sizeInKB) { String fileContentToBeWritten = ""; BufferedReader br = null; try { br = new BufferedReader(new FileReader(filePathToRead)); StringBuilder sb = new StringBuilder(); String line = br.readLine(); while (line != null) { sb.append(line); sb.append('\n'); line = br.readLine(); } fileContentToBeWritten = sb.toString(); } catch (FileNotFoundException e) { log.error("File to read sample string to create text file to send is not found", e); } catch (IOException e) { log.error("Error in reading sample file to create text file to send", e); } finally { try { if (br != null) { br.close(); } } catch (IOException e) { log.error("Error while closing buffered reader", e); } } if (deleteRandomFile(filePathToCreate)) { <START> log.info("File requested to create already exists. Deleting file... " + filePathToCreate); <END> } try { File fileToCreate = new File(filePathToCreate); boolean createFileSuccess = fileToCreate.createNewFile(); if (createFileSuccess) { log.info("Successfully created a file to append content for sending at " + filePathToCreate); } BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(filePathToCreate)); PrintWriter printWriter = new PrintWriter(bufferedWriter); for (int count = 0; count < sizeInKB; count++) { printWriter.append(fileContentToBeWritten); } printWriter.flush(); printWriter.close(); } catch (IOException e) { log.error("Error. File to print received messages is not provided", e); } }</code><technical_language>deletion in deleteRandomFile(..) ? if info changed mention deleted ? 'deleting..' sounds deleted</technical_language>

Target:
public static void createMockFile(String filePathToRead, String filePathToCreate, int sizeInKB) { String fileContentToBeWritten = ""; BufferedReader br = null; try { br = new BufferedReader(new FileReader(filePathToRead)); StringBuilder sb = new StringBuilder(); String line = br.readLine(); while (line != null) { sb.append(line); sb.append('\n'); line = br.readLine(); } fileContentToBeWritten = sb.toString(); } catch (FileNotFoundException e) { log.error("File to read sample string to create text file to send is not found", e); } catch (IOException e) { log.error("Error in reading sample file to create text file to send", e); } finally { try { if (br != null) { br.close(); } } catch (IOException e) { log.error("Error while closing buffered reader", e); } } if (deleteRandomFile(filePathToCreate)) { log.info("File requested to create already exists. Deleted file: " + filePathToCreate); } try { File fileToCreate = new File(filePathToCreate); boolean createFileSuccess = fileToCreate.createNewFile(); if (createFileSuccess) { log.info("Successfully created a file to append content for sending at " + filePathToCreate); } BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(filePathToCreate)); PrintWriter printWriter = new PrintWriter(bufferedWriter); for (int count = 0; count < sizeInKB; count++) { printWriter.append(fileContentToBeWritten); } printWriter.flush(); printWriter.close(); } catch (IOException e) { log.error("Error. File to print received messages is not provided", e); } }