Line | |
---|
1 | package testcode;
|
---|
2 |
|
---|
3 | import java.io.IOException;
|
---|
4 | import java.nio.file.Files;
|
---|
5 | import java.nio.file.Paths;
|
---|
6 |
|
---|
7 | import org.eclipse.jdt.annotation.NonNull;
|
---|
8 |
|
---|
9 | public 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.