| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- package rocks.zipcode;
-
- import java.io.*;
- import java.nio.file.Files;
- import java.util.Arrays;
- import java.util.List;
- import java.util.Scanner;
-
- /**
- * @author leon on 16/11/2018.
- */
- public class Document implements DocumentInterface {
-
- private final FileWriter fw;
- // private final File file;
-
- public Document(String fileName) throws IOException {
- this(new File(fileName));
- }
-
- public Document(File file) throws IOException {
- // this.file = file;
- this.fw = new FileWriter(file);
- }
-
- @Override
- public void write(String contentToBeWritten) {
- try {
- fw.write(contentToBeWritten);
- fw.close();
- } catch (IOException ex) {
- ex.printStackTrace();
- }
- }
-
- @Override
- public void write(Integer lineNumber, String valueToBeWritten) {
- // Scanner scanner = null;
- // try {
- // scanner = new Scanner(file);
- // } catch (FileNotFoundException e) {
- // e.printStackTrace();
- // }
- // StringBuilder sb = new StringBuilder();
- // while(scanner.hasNextLine()){
- // sb.append(scanner.nextLine());
- // }
- // String content = sb.toString();
-
- }
-
- @Override
- public String read(Integer lineNumber) {
- return null;
- }
-
- @Override
- public String read() throws FileNotFoundException {
- return null;
- }
-
- @Override
- public void replaceAll(String stringToReplace, String replacementString) {
- }
-
- @Override
- public void overWrite(String content) {
- }
-
- public List<String> toList() {
- return null;
- }
-
- @Override
- public File getFile() {
- return null;
- }
-
- @Override
- public String toString() {
- return null;
- }
- }
|