Updated example to cat the version properties file.

This commit is contained in:
Erik C. Thauvin 2018-07-07 01:40:16 -07:00
parent abe1ca269c
commit b50f2bad9a
10 changed files with 58 additions and 26 deletions

View file

@ -1,12 +1,20 @@
/*
* This Java source file was generated by the Gradle 'init' task.
*/
public class App {
public static void main(String[] args) {
System.out.println(new App().getGreeting());
}
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
public String getGreeting() {
return "Hello world.";
public class App {
public static void main(String... args) throws IOException {
if (args.length == 1) {
final Path path = Paths.get(args[0]);
if (Files.exists(path)) {
final List<String> content = Files.readAllLines(path);
System.out.println("> cat " + path.getFileName());
for (final String line : content) {
System.out.println(line);
}
}
}
}
}
}