Skip to content

Instantly share code, notes, and snippets.

@planetsizebrain
Last active September 4, 2016 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save planetsizebrain/871e41b17fe8f0fdd56af2a9e0736f1a to your computer and use it in GitHub Desktop.
Save planetsizebrain/871e41b17fe8f0fdd56af2a9e0736f1a to your computer and use it in GitHub Desktop.
Small Liferay Groovy script that lists the contents of a directory
import java.io.*;
try {
File directory = new File("/opt/liferay");
for (File f : directory.listFiles()) {
out.println(f.name + " " + f.size());
}
} catch (Exception e) {
out.println(e.getMessage());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment