@@ -0,0 +1,1432 @@
+package edu.java.cosc111.samples;%0A%0Aimport java.io.IOException;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.OpenOption;%0Aimport java.nio.file.Path;%0Aimport java.nio.file.Paths;%0Aimport java.nio.file.StandardOpenOption;%0Aimport java.util.Arrays;%0Aimport java.util.List;%0Aimport java.util.Scanner;%0A%0A/**%0A *%0A * @author rlvillacarlos%0A */%0Apublic class SimpleTextFileReadAndWrite %7B%0A%0A    /**%0A     * @param args the command line arguments%0A     */%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        Scanner in = new Scanner(System.in);%0A        %0A        System.out.print(%22Enter path: %22);%0A        Path p = Paths.get(in.nextLine());%0A        List%3CString%3E data = Arrays.asList(%221,2,3,4,5,6,7,8,9,10%22.split(%22,%22)) ;%0A        if(Files.exists(p))%7B%0A            System.out.printf(%22The file %25s already exists%25n%22, p.toAbsolutePath());%0A            System.out.print(%22Do you want to append? (y/n)%22);%0A            %0A            if(in.nextLine().substring(0, 1).equalsIgnoreCase(%22y%22))%7B%0A                System.out.println(%22--Writing Data--%22);%0A                Files.write(p, data,StandardOpenOption.APPEND);    %0A            %7D%0A        %7Delse%7B%0A            System.out.println(%22--Writing Data--%22);%0A            Files.write(p, data);        %0A        %7D%0A        System.out.println(%22--Reading Data--%22);        %0A        List%3CString%3E contents = Files.readAllLines(p);%0A        for(String c:contents)%7B%0A            System.out.println(c);%0A        %7D%0A    %7D%0A    %0A%7D%0A

Add sample to test basic creation, writing, and reading text files