Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class RequirementsCoverage {
- public static void writeToFile(String append) {
- String filePath = "src/main/resources/requirements_coverage/requirements_coverage.txt";
- String content = "";
- try {
- content = new String(Files.readAllBytes(Paths.get(filePath)));
- } catch (IOException e) {
- System.out.println("An error occurred.");
- e.printStackTrace();
- }
- if (!content.contains(append)){
- try {
- FileWriter myWriter = new FileWriter(filePath);
- myWriter.write(content + "\n" + append);
- myWriter.close();
- System.out.println("Successfully wrote Requirements coverage to the file.");
- } catch (IOException e) {
- System.out.println("An error occurred.");
- e.printStackTrace();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement