/
Zakonreal
/
practice06
Обзор
Документация
Войти
/
Zakonreal
/
practice06
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/main/java/org/example/App.java
31 строка
1 KB
RodinRoman
init
15 май 2025, 03:23
15 май 2025, 03:23
17d6e58
Код
Авторство
О чём код?
package org.example; import analizer.DirectoryAnalyzer; import analizer.DirectoryStatistics; import java.io.IOException; import java.nio.file.*; import java.util.List; public class App { public static void main( String[] args ) throws IOException { Path path = Paths.get("pom.xml"); System.out.println("path = " + path); System.out.println("file name = " + path.getFileName()); System.out.println("parent = " + path.getParent()); System.out.println("absolute path = " + path.toAbsolutePath()); List<String> lines = Files.readAllLines(path); System.out.println("lines count: " + lines.size()); System.out.println(lines); //Files.createDirectory(Paths.get("temp")); Files.copy(path, Paths.get("temp", "pom.xml.backup"), StandardCopyOption.REPLACE_EXISTING); System.out.println(Files.size(Paths.get("temp", "pom.xml.backup"))); DirectoryAnalyzer analyzer = new DirectoryAnalyzer(Paths.get("temp")); analyzer.analyze(); analyzer.getStatistics(); } }