source: java2python/core/src/test/java/testcode/FileRead.java

Last change on this file was 1095, checked in by wouter, 3 months ago

fig Path.of -> Paths.get

File size: 477 bytes
Line 
1package testcode;
2
3import java.io.IOException;
4import java.nio.file.Files;
5import java.nio.file.Paths;
6
7import org.eclipse.jdt.annotation.NonNull;
8
9public class FileRead {
10
11 static public void main(String[] args) throws IOException {
12 // Files.readString is only since 11 or 12 so not used here.
13 final @NonNull String res = new String(
14 Files.readAllBytes(Paths.get("pom.xml")));
15 //System.out.println(res);
16 System.out.println(res.length() > 100 ? "ok" : "ko");
17 }
18
19}
Note: See TracBrowser for help on using the repository browser.