I wonder how can I complete this task without import java.nio.file.Path;?
package com.codegym.task.task31.task3103;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
import java.util.List;
/*
Your own implementation
*/
public class Solution {
public static byte[] readBytes(String filename) throws IOException {
Path path = Paths.get(filename);
byte[] bytes = Files.readAllBytes(path);
return bytes;
}
public static List<String> readLines(String filename) throws IOException {
Path path = Paths.get(filename);
List<String> list = Files.readAllLines(path);
return list;
}
public static void writeBytes(String filename, byte[] bytes) throws IOException {
Path path = Paths.get(filename);
Files.write(path, bytes);
}
public static void copy(String resourceFilename, String destinationFilename) throws IOException {
Path resource = Paths.get(resourceFilename);
Path destination = Paths.get(destinationFilename);
Files.copy(resource, destination);
}
}