Updated example to cat the version properties file.
This commit is contained in:
parent
abe1ca269c
commit
b50f2bad9a
10 changed files with 58 additions and 26 deletions
|
@ -11,8 +11,9 @@ public class App {
|
|||
public void cat(String name) {
|
||||
try {
|
||||
final List<String> content = Files.readAllLines(Paths.get(name));
|
||||
System.out.println("> cat " + name);
|
||||
for (String line : content) {
|
||||
if (!line.startsWith("#")) System.out.println(line);
|
||||
System.out.println(line);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
System.out.println(e);
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
f = new File("examples.properties")
|
||||
println(f.absoluteFile)
|
||||
println(f.exists())
|
||||
println(f.canRead())
|
||||
if (this.args.length > 0) {
|
||||
for (arg in this.args) {
|
||||
f = new File(arg)
|
||||
println("${f.name}\t-> exits: ${f.exists()}, canRead: ${f.canRead()} --> `${f.absoluteFile}`")
|
||||
}
|
||||
} else {
|
||||
println("Usage: groovy ${this.class.getName()} filename")
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue